Mounting and quickly dismounting vehicle does not move player to vehicle but only teleports them relatively to their position
The bug
Mounting a vehicle (like a minecart, a boat, a pig or a horse) and quickly dismounting it does not teleport the player to the vehicle but only dismounts them relative to their position.
Expected behavior
The player would be properly moved to the vehicle first and then dismounted at the position of the vehicle.
How to reproduce
- Stand in front of a vehicle
- Mount the vehicle (default: right-click)
- Quickly dismount it (default: shift)
Code analysis
Based on 1.12 decompiled using MCP 9.40 PRE 1
It looks like this bug can be caused by two different bugs:
- The passenger position is not directly updated but instead by the method net.minecraft.entity.Entity.updatePassenger(Entity) one tick later (see also
MC-111747). - The server sends a SPacketPlayerPosLook packet with the old entity position in net.minecraft.entity.player.EntityPlayerMP.startRiding(Entity, boolean).
Created Issue:
Getting in vehicle and out really quickly only teleports player up a half block
This affects all vehicles but the following part is based on the bug with the Minecart.
What I expected:
Caused byMC-3328I would expect if a player who is holding Shift (or the key to get out of vehicles) right clicks a Minecart, he would get to the position of the Minecart.What happens:
Depending on when the progress of getting in the Minecart is canceled, it can happen that the player stays at his original position and only gets teleported up half a block.The game should finish the "getting in vehicle" function before cancelling it. This way it would be impossible that this bug happens because the player gets the correct position before getting out of the vehicle.
Gettingin vehicle and out reallyquickly only teleports player up a half blockMounting and dismounting vehicle quickly only teleports player up a half block
Mounting and dismounting vehiclequickly only teleports player up a half blockMounting and quickly dismounting vehicle does not move player to vehicle but only teleports them relatively to their position
This affects all vehicles but the following part is based on the bug with the Minecart.What I expected:
Caused byMC-3328I would expect if a player who is holding Shift (or the key to get out of vehicles) right clicks a Minecart, he would get to the position of the Minecart.What happens:
Depending on when the progress of getting in the Minecart is canceled, it can happen that the player stays at his original position and only gets teleported up half a block.The game should finish the "getting in vehicle" function before cancelling it. This way it would be impossible that this bug happens because the player gets the correct position before getting out of the vehicle.
The bug
Mounting a vehicle (like a minecart, a boat, a pig or a horse) and quickly dismounting it does not teleport the player to the vehicle but only dismounts them relative to their position.
Expected behavior
The player would be properly moved to the vehicle first and then dismounted at the position of the vehicle.
How to reproduce
- Stand in front of a vehicle
- Mount the vehicle (default: right-click)
- Quickly dismount it (default: shift)
Is this still an issue in the most recent versions (i.e. 1.10.2, or 16w42a) of Minecraft?
Not really an in-depth code analysis, but it appears that this can be caused by the same bug which causes
MC-111747(passenger position not directly updated) but apparently also by the client send position packets for their previous position.
The bug
Mounting a vehicle (like a minecart, a boat, a pig or a horse) and quickly dismounting it does not teleport the player to the vehicle but only dismounts them relative to their position.
Expected behavior
The player would be properly moved to the vehicle first and then dismounted at the position of the vehicle.
How to reproduce
- Stand in front of a vehicle
- Mount the vehicle (default: right-click)
- Quickly dismount it (default: shift)
Code analysis
Based on 1.12 decompiled using MCP 9.40 PRE 1
It looks like this bug can be caused by two different bugs:
- The passenger position is not directly updated but instead by the method net.minecraft.entity.Entity.updatePassenger(Entity) one tick later (see also
MC-111747).- The server sends a SPacketPlayerPosLook packet with the old entity position in net.minecraft.entity.player.EntityPlayerMP.startRiding(Entity, boolean).
Confirmed for 1.13.1.
Confirmed in 1.15.2, but fixed in 1.16 Pre-release 5 or earlier.