Mojira Archive
MC-103672

Steerable ridden entities (boats / pigs / horses) teleport back to their previous position for a short moment on dismount

The bug

Steerable ridden entities like boats, pigs or horses teleport client-side to the position where you first started steering them for a short moment when you stop steering them. You can stop steering such an entity by either dismounting it or for example for pigs stop holding a carrot on a stick or for horses remove the saddle from the horse.

Video example: https://www.youtube.com/watch?v=ATXLXGaq-q8

How to reproduce

  1. Start riding a steerable entity like for example a boat
  2. Switch to third person view (F5) (back view) to be able to see the complete boat
  3. Move a while in it
  4. Dismount it
    → You will see that the boat is teleported for a short moment to the position where you first started riding it

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.entity.EntityLivingBase.onLivingUpdate() ignores all position and movement changes caused by the method net.minecraft.entity.EntityLivingBase.setPositionAndRotationDirect(double, double, double, float, float, int, boolean), which then, once the riding player is not steering it anymore, take effect. It might be good if the server would not send the packets calling this method if the entity is being steered or if this method would only set the field values if if the entity is not being steered.