Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

The anatomy of a Minecraft model

How to work with and create models for Minecraft

To Mount an Entity

  • 2013-10-01 23:07:47
    Hi guys, it's me again, and I have one more problem. I have made a rather tall mountable entity (1 width, 2.5F height), also 2.2F mounted Y offset. The problem is that when I try to dismount, the dismounting method in EntityLivingBase goes crazy and decides the player who dismounted needs to go straight to hell - well, y = 0, anyway. This can be fixed by lowering the mounted Y offset or by putting a block by the side of the entity to dismount onto. However, neither of these are convenient for me. One other thing is that the entity will let you dismount normally most of the time if you relog after you have spawned the entity. Any ideas?

    P.S. Sorry for two questions in a row, but the Badge Hunt told me to ask more questions.
  • 2013-10-03 19:21:26
    Vswe, sorry to nag but do you have any idea how I could solve this? I did find a quick-fix - tell the server the player's Y offset is only 1F, but tell the client it's 2.2F. I'm guessing, however, this would show the player in the wrong place from someone else's POV on multiplayer. Any help with fixing this would be greatly appreciated. Thanks,
  • 2013-10-04 22:27:13
    I can't remember if it's possible or not. Can you override the dismount method? If so you could write your own dismount code. But like I said I'm not entirely sure if it's possible.
  • 2013-10-04 22:40:37
    The problem is the dismount code is in the EntityLivingBase class, and so obviously I can't override that (short of modifying the vanilla code :P). I don't know why the mounted entity isn't allowed to control dismounting (would seem to make more sense), but all it's allowed to do is set its riddenByEntity to null. Thing is, I was thinking, Flan has planes and tanks which must have the player sitting quite high, and you can dismount them in mid air and not get sent to y = 0). I might try to ask him. Unless there is some way to override methods in the EntityLivingBase class? Anyway, quick and dirty fix is applied for now. Thanks for the answer. :)
  • Log in or sign up to reply to this thread