Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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.

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.

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/

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.