Can I make more than one seat for my car?

Started by Zeyler on Tue, 09/27/2022 - 13:08

Topic category: Advanced modding

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Can I make more than one seat for my car?
Tue, 09/27/2022 - 13:08

I am currently working on a mod for a car. I am planning to create a minivan or sports car in it, but I don't know how to create multiple seats. Can you tell me how to do that?
If you use a code, even a rough one, I would appreciate it if you could teach me.

Last seen on 16:12, 25. Oct 2022
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Goodmorning everybody.   I'm…
Sun, 10/02/2022 - 04:44

Goodmorning everybody.

 

I'm also looking for an answer. Any advices about it ? Is it possible with blockbench by changing the bone config to an invisible Minecart, the same way as Bedrock ?

 

Thanks all.

Last seen on 16:12, 25. Oct 2022
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Well I found the solution if…
Mon, 10/03/2022 - 08:38

Well I found the solution if anyone is asking.

 

Just go in the code of your entity, then in the name of your class, extend to the Vanilla Minecraft entity.

 

public class NameOfYourEntity extends
MineCartEntity {
}

Then from here, override with whatever you want (speed, can be pushed, etc...)

Last seen on 16:12, 25. Oct 2022
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oops wrong topic, sorry.
Mon, 10/03/2022 - 09:16

Oops wrong topic, sorry.

Last seen on 16:12, 25. Oct 2022
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Anyway, does someone as an…
Mon, 10/03/2022 - 12:04

Anyway, does someone as an idea ?

 

 

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Probably not.
Mon, 10/24/2022 - 08:57

Probably not.

Last seen on 20:51, 2. Dec 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If you add this to your…
Mon, 10/24/2022 - 13:46
If you add this to your entity code it will work:


        public boolean canFitPassenger(Entity passenger) {
            return this.getPassengers().size() < 2;
        }


        public void updatePassenger(Entity passenger) {
            if (this.isPassenger(passenger)) {
                float f = 0.0F;
                float f1 = (float) ((this.removed ? (double) 0.01F : this.getMountedYOffset()) + passenger.getYOffset());
                if (this.getPassengers().size() > 1) {
                    int i = this.getPassengers().indexOf(passenger);
                    if (i == 0) {
                        f = 0.2F;
                    } else {
                        f = -0.6F;
                    }
                    if (passenger instanceof AnimalEntity) {
                        f = (float) ((double) f + 0.2D);
                    }
                }
                Vector3d vector3d = (new Vector3d((double) f, 0.0D, 0.0D))
                        .rotateYaw(-this.rotationYaw * ((float) Math.PI / 180F) - ((float) Math.PI / 2F));
                passenger.setPosition(this.getPosX() + vector3d.x, this.getPosY() + (double) f1, this.getPosZ() + vector3d.z);
            }
        }
Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If I make more than one of…
Tue, 10/25/2022 - 12:18

If I make more than one of those, can I have more than one seat?

 

Last seen on 14:18, 2. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hey. Have you already tried…
Thu, 10/27/2022 - 22:35

Hey. Have you already tried ImOd's idea?

I used a different, crude method to achieve this with my own vehicle mod. I made a rideable "back seat" entity that automatically alings itself to (behind) the "mother entity". It's probably messy in comparison since it adjusts its north, east, south, west - orientation via procedures an thus the back seat with the passenger in it "snaps" if you drive at an angle close to 45° off from exactly noth, east etc. but it is the closest to a usable mechanic I could find.

Last seen on 14:18, 2. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The procedure must of course…
Fri, 10/28/2022 - 10:05

The procedure must of course be bound to the trigger "on entity tick update" of the back seat-entity

The result looks like this:

 

 

 

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
wow. nice!
Sat, 10/29/2022 - 08:49

wow. nice!

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Show me the procedure at the…
Sun, 11/06/2022 - 06:02

Show me the procedure at the bottom.

Last seen on 14:18, 2. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You mean the one that is…
Sun, 11/06/2022 - 09:56

You mean the one that is completely cut out of the screenshot? That's not important for it to work. It is literally the same procedure group as the one you see there once again, but testing for another type of mother entity besides "AirshipTest" as above. This is so that the backseat would behave the same way with multiple vehicles - or slightly different. You could, for example, adjust the distance between mother entity and backseat if the seacond vehicle is shorter or longer. In the example shown the distance is the X/Z of +/-  1.35 depending on which direction the mother entity faces.
Just know that the bigger that distance is set, the more "out of line" the backseat and the main vehicle become when you turn (see the first of the 2 ingame screenshots)
 

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ok. thanks!
Sun, 11/06/2022 - 10:40

ok. thanks!

Last seen on 12:11, 21. Nov 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So I can create an entity…
Sun, 11/06/2022 - 10:43

So I can create an entity for the car and an entity for the back?