Moving Elevators

Moving Elevators

8M Downloads

[Bug] ...Mobs Die When Descending Using "Moving Elevators"

SGMax1 opened this issue · 3 comments

commented

When mobs are brought into the "elevator" and descend from a height, they will be hurt from the fall at the moment the elevator entity transforms into a block. It seems that the falling distance equivalent to the elevator's travel height has been accumulated!

P.S.: (Poor my horse with a jump of 4.93 and a speed of 13.92)
I am a player from China. I am using AI translation for this conversation, so I apologize if there are any inaccuracies or unclear expressions.

commented

Please fill in the template. There's nothing I can do without the requested information.
What Minecraft version are you using? What modloader are you using? What version of Moving Elevators are you using?
Are you using OptiFine?

commented

Setup:

  • Minecraft 1.21.4 Java (Fabric)
  • Moving Elevators 1.4.10
  • No OptiFine installed

What happened:
I rode my horse into the elevator and stayed mounted. Started descending with platform speed 0.2 (about 40 blocks down). Mid-ride, I tapped Spacebar trying to make the horse jump (you know how players sometimes get stuck in elevator ceilings when jumping? Same idea). The horse didn't actually jump though.

When we reached the bottom, the exact moment the elevator turned back into blocks:

  • Horse instantly died (like it fell 40 blocks!)
  • I stayed completely unharmed
commented

As player movement is handled client-side, Moving Elevators sends a packet to the server whenever the client's player is moved by the elevator. The packet then essentially stores a timestamp on the player server-side and within 5 seconds of that timestamp all fall damage for the player is cancelled.
Entities controlled by the player are similar to the player itself also handled client-side. I have now changed the packet behaviour to store the timestamp on the player's mount rather the player itself whenever the player is riding an entity. This should prevent fall damage from being applied to the entity being ridden by the player as well.

In addition, it seems horses and camels specifically override their fall damage behaviour and do not use the default living entity behaviour. All other mobs use the default fall damage behaviour and just expand upon it.
Moving Elevators injected into the default fall damage behaviour to cancel the fall damage, hence for horses and camels this did not work.
I have also changed the elevator movement code to check for the stored timestamp as well and already cancel fall damage and reset the fall distance. Although this does not cover all cases, it hopefully works sufficiently well for horses and camels that you shouldn't run into the issue.

The changes are available in Moving Elevators version 1.4.11 which should fix the issue.
Thank you for reporting the issue!