Posted May 6, 201510 yr 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.
May 7, 201510 yr 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.
May 7, 201510 yr 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.
May 7, 201510 yr 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/
May 8, 201510 yr Author 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.
May 8, 201510 yr 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.