If you quickly press the sneak key in a laggy world or a server, the sneak animation will often play twice.
I suspect this could be because the client and the server are in disagreement of the player's sneak state.
In my clips it isn't as severe, but many times I have had experiences that are much worse.
Video:
[media]Linked issues
is duplicated by 8
Attachments
Comments 24

The issue occurs when the player releases the sneak key before the first metadata update is received by the client.
This is what happens with low latency:
Sneak key pressed -> Player starts sneaking
Client receives metadata update with sneaking=true
Sneak key released -> Player stops sneaking
Client receives metadata update with sneaking=false
But with a latency higher than the time between pressing and releasing the sneak key:
Sneak key pressed -> Player starts sneaking
Sneak key released -> Player stops sneaking
Client receives metadata update with sneaking=true -> Player starts sneaking again
Client receives metadata update with sneaking=false -> Player stops sneaking again
It seems like the client isn't actually sneaking, only the point of view and player pose is changed.
Affects 1.16.2.
It only happens with me on a server, can someone help me please? it double sneaks or bounce idk how! it happens with me in every version !
The same bug also affects sprinting, if I sprint on a server with bad ping it stops me from sprinting for a short moment and then restarts, or starts wobbling forever... it actually makes sprinting in 1.16 unusable... thinking about modding it out just to make the game playable again.

Can confirm in 1.21
@unknown: Please stop uploading video footage taken in a modified environment and confirming the bug for an already added version.

@turbo sorry, but you deleted my first comment instantly without any explanation, so I just thought it was an upload bug and sent it again.

Can confirm from 1.21 to 1.21.5
btw, here’s another fabric mod that fixes this. As of writing this it’s listed for more versions than sneakfix but I believe the code is pretty much the same https://modrinth.com/mod/no-double-sneak

Turns out Krypton also majorly helps with this bug. I only got an almost imperceptible desync once when I was really trying to get the sneak bug. https://modrinth.com/mod/krypton
Affects 1.15.2