Jump to content

Recommended Posts

Posted

Would it be possible to have two people riding one entity? (Only one would control the vehicle, the other just sits in there.)

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

Short: Yes

 

Longer: Making Player move on server side only (since normally it's done also on client) might cause some laggy-movements on client, since server will be making your client player move.

1.7.10 is no longer supported by forge, you are on your own.

Posted

I believe Flans mod accomplishes this. Maybe check their github?

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

I think one approach might be as follows. When second player is mounted, the RenderPlayerEvent would render that player as you want in the vehicle (while cancelling normal rendering). The rendering would use exact position based on the vehicle to avoid lag issues that Ernio mentions. But you would still also keep the positions up to date on both client and server. You'd also have to intercept the second player's input to avoid it trying to control player position while mounted.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

How would I make the second rider mount my vehicle and become a second riddenBy entity?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

Just think dude.

Entity has 2 Entity fields - riddenByEntity and riddingEntity. There is a method that is being called every tick.

public void updateRiderPosition()
    {
        if (this.riddenByEntity != null)
        {
            this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ);
        }
    }

 

This is called somewhere around update methods.

 

What you need is it inside your own MyEntity.class ass 3rd Entity field - "passenger" or something and every tick update his position. To make all smooth you will need to read some vanilla - there is a good deal going on there - don't forget NBTs, resetting states (nulling) and all that shit.

1.7.10 is no longer supported by forge, you are on your own.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.