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
Attachments
Comments

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.
i've been looking for a solution temporary for months. I figured there must be a mod out there that tries to fix this and i finally found it a few minutes ago, I haven't played around with it for long and tried this mod with all features off except the "shift fix" feature which i left on and it seems to work. Use at your own risk, this is just a brilliant mod i found that seems to work for me
here's a link to the mod Giz5
Can confirm for 21w20a.
I don't like my mod being called "random" but thanks for using my mod anyways.
Well, the reason this bug happens is that the server sends entity pose packet to the client.
When a player sneaks
Client sends entity pose packet(start sneaking)
Server receives entity pose packet
A player stops sneaking, and the client sends entity pose packet(stop sneaking)
Server sends entity pose packet(start sneaking)
Client receives "start sneaking" packet, even though the player has already stopped sneaking
Client stops sneaking 1 tick later
Client receives "stop sneaking" packet
@Toshimichi, I apologize for calling Ur mod random, I assure u I didn't mean it in a negative way, I have corrected and edited my poor choice of words. We should all appreciate the time and effort that goes into making mods like this and what an amazing thing it is for the community to have. Ur mod is indeed a brilliant mod that implemented a fix before mojang and that should be applauded
Affects 1.18
Confirmed still affects 1.18.1 and 1.18.2.
Can confirm for 1.19
can confirm in 1.19
can confirm in 1.18.2
can confirm in 1.18.1
Can confirm in 1.19.3, 1.19.4, 1.20, and 1.20.1.
Still affects 1.20.2 through 1.20.3 pre1
It doesn't even have to be a laggy server, it's happening to me on my private worlds. Although even slight lag makes it much worse. Also basic fabric mod here to fix it if anyone wants it https://modrinth.com/mod/sneakfix
Can confirm in 1.20.3 and 1.20.4

The clip provided in the description no longer works. Would it be possible to provide an updated link or reupload the content?

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