Jump to content

[Help] Prevent player from falling off mount


big_red_frog

Recommended Posts

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 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.