mojira.dev
MC-97423

Horse temporarily stuck in jump animation if dismounted

The bug

If you dismount a horse in mid jump, the horse will continue to do the jump animation even after landing on the ground for around 10 seconds. The horse will even start to walk away stuck in the animation until it ends.

How to reproduce

  1. Tame a horse and put a saddle on it

  2. Start riding it

  3. Hold the jump key (space)

  4. Release the jump key and at the same time press the dismount key (shift)
    ❌ The horse remains in the jump animation

The reason (by MC-104523)

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

I assume that the reason for this is that rearing is only done client side. The method net.minecraft.entity.passive.EntityHorse.onUpdate() contains a part that causes the horse to stop rearing. The following conditions are used. Keep in mind that they are all required and in Java if one condition fails all following conditions are not tested.

  1. If controlling passenger is a player:

    1. True condition: Player is client player

    2. False condition: Code is run by server

  2. Horse is rearing for more than 0 ticks

  3. Add one to horse rearing time, new value has to be greater than 20

If all these conditions are met the rearing value is set to false. This means that as soon as the player dismounts the horse, the rearing time stops incrementing.

When the client receives a SPacketEntityMetadata packet, the rearing state updates, because the value if the horse is rearing or not is stored with other states in the data watcher as one value (single bits of the value representing the value of the states) and rearing is only client side.

Removing the condition that the controlling passenger has to be a player would probably fix this bug.

Linked issues

MC-99365 Dismounting horse while jumping causes horse to stay on hind legs Resolved MC-106754 Horse jump animation bug Resolved MC-108687 Horse Animation bug / Stored horse jump bug Resolved MC-121626 Riding and dismounting a horse will remain it to stay on its hind legs Resolved MC-121761 Horse Bug 1.13 Resolved

Attachments

Comments 19

Confirmed for 1.9-pre2.

Still in 1.9.1-pre3

Confirmed for 1.9.3-pre1

Confirmed for 1.9.3-pre2

9 more comments

Confirmed for 1.16.2

Can confirm in 20w48a.

Can confirm in 21w03a.

Can confirm in 21w05b.

Can confirm in 1.21.5

goody2shoos

Panda4994

Confirmed

Gameplay

Low

Mob behaviour

animation, horse, jump

Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 16w15b, ..., 21w05b, 1.17.1, 1.19.2, 25w09b, 1.21.5

Minecraft 1.13, 25w20a

Retrieved