Snapshot 13w09c, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.8, Minecraft 15w32c, Minecraft 15w36d, Minecraft 15w38b, Minecraft 15w45a, Minecraft 1.11.2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b
If a player passes through a nether portal while in sneak mode, that player retains some properties of sneaking after coming out on the other side.
- Cannot open chests, flip levers, etc.
- Visually appears crouched to other players (including nameplate being hidden by opaque blocks)
- Moves at full normal speed, despite appearing crouched
- Falls off of block ledges, despite appearing crouched
- Able to break and place blocks normally
Effect remains until player presses/releases sneak key.
Video of the behavior:
Code analysis by quadraxis
Minecraft.setDimensionAndSpawnPlayer creates a new player entity, mostly losing the field values from the old one.
This causes the client to "forget" that the player was previously sneaking, and so it will not send a status update packet to the server as it believes that the sneak status is unchanged, causing the issue.
This issue can be fixed by changing setDimensionAndSpawnPlayer to copy the values used to determine when status update packets are sent (inside EntityPlayerSP.onUpdateWalkingPlayer) across to the newly-created player.