When the player is sneaking or otherwise moving more slowly than normal, the angle at which they walk gets biased to align with the closest cardinal direction. This effect is most pronounced when the player's angle is only slightly off from the nearest cardinal direction.
Easy way to reproduce and visually demonstrate:
- Go to a flat plane (i.e. a superflat world) and set down two command blocks adjacent to each other, one Impulse and one Repeating.
- In the Repeating command block, put in "/execute as @a as @s run summon minecraft:armor_stand ~ ~ ~ {Small:1b}". This will produce a trail of Armor Stands when the block is powered, to record the player's movement path.
- Select a position in the world about 10 blocks away from the command blocks, in any cardinal direction.
- Create a teleport command that will put you at that specific position. Include the two extra fields for the camera angle, such that the yaw is 6 degrees off from the nearest multiple of 90, pointing you towards the command blocks. I.e. if the position you selected is directly South of the command blocks, the yaw field would need to be 174 or 186.
- Copy the teleport command into the Impulse command block, and then place a lever directly on either command block.
- Aim at the lever, lift your mouse off the table to avoid adjusting your angle manually, and activate the lever.
- Hold W until you are close to the lever, then stop moving and turn it off.
- Repeat step 6
- Hold W and Shift until you are close to the lever, then stop moving and turn it off
- Observe the difference in angle between the two lines of Armor Stands - when sneaking, your angle was flattened out towards the closest cardinal direction.
Expected behaviour: The magnitude of the player's velocity should have no effect on the angle.
Image of the completed set of steps, creating two lines of Armor Stands representing paths of movement:
Edited version with labels: