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

Hi all,

 

For various reasons I want to prevent a player from being knocked off a pig by random mobs.

 

Is there a simple way to do this?

 

I am always running in creative mode for my purposes, but random interactions spoil my intent...

 

( At least I think that is the problem, I have not as yet caught the condition that causes the player to be off the pig )

There are only a few cases I know of that causes a player to be dismounted:

  • The player presses shift
  • The player is in a minecart and goes over a powered activator rail
  • The player is mounting and untamed horse and the horse throws the player off
  • The entity the player is riding is killed
  • Another mod causes it for some reason

Which of these reasons do you want to prevent?

 

Edit: as diesieben07 pointed out below, you can also get dismounted in water

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • Author

Thanks for any and all help.

 

It is great to know that there are a limited number of scenarios to knock a player off, this gives me a clue.

 

When this has occured, there is no player at keyboard so can't be that.

Its a derived pig class with removed AI, so it is not the minecart scenario.

Its not an untamed horse.

The pig is a super pig and invulnerable.

No other mods.

 

I have been digging around, is there another scenario that could cause this, due to the ridden pig moving through standing water?

 

By standing water, I mean a pool of water left on a level surface as the whole area that previously supported the water has been removed and it falls down and forms an active pool.

 

Ok, this is a thing in vanilla, you get dismounted under water.

Dang, I forgot you get dismounted in water, I'll edit above

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

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.