Sneak desync between client and server
Expected behaviour
Whenever the player model is sneaking, the is_sneaking predicate should return true, and the sneak_time scoreboard should go up.
Observed behaviour
In some scenarios, the predicate returns "false" even if the player sneaks. In particular, this happens when keeping shift held after dismounting an entity.
This indicates a desync between client and server. The server sees you stand normally, while client-side you're crouching.
Steps to reproduce
- Track sneaking time, using either (or both) of the following two options:
- Set up a "sneak_time" scoreboard:
/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time)
and display it in the sidebar:
/scoreboard objectives setdisplay sidebar sneaktime
- Set up a datapack with an is_sneaking predicate, then place down a command block that checks for it
- Set up a "sneak_time" scoreboard:
- Mount an entity (/ride or manually; easiest is a boat). Immediately dismount and keep holding the sneak button.
- Notice how the sneak_time scoreboard doesn't increment (or how the predicate doesn't return true)
Created Issue:
Sneak detection inconsistency
What's supposed to happen:
Whenever the player model is sneaking, the is_sneaking predicate should return "true".
What happens instead:
In some scenarios, the predicate returns "false" even if the player sneaks.
How to reproduce:
- Either:
- Set up a datapack with an "is_sneaking" predicate, then place down a command block that checks for it
- or (recommended) set up a "sneak_time" scoreboard (/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time) and display it in the sidebar (/scoreboard objectives setdisplay sidebar sneaktime)
- Mount an entity (/ride or manually) and immediately dismount and keep holding the sneak button.
- Notice how the "sneak_time" scoreboard doesn't increment (or how the predicate doesn't return "true")
What's supposed to happen:
Whenever the player model is sneaking, the is_sneaking predicate should return "true", and the "sneak_time" scoreboard should go up.
What happens instead:
In some scenarios, the predicate returns "false" even if the player sneaks.
How to reproduce:
- Either:
- Set up a datapack with an "is_sneaking" predicate, then place down a command block that checks for it
- or (recommended) set up a "sneak_time" scoreboard (/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time) and display it in the sidebar (/scoreboard objectives setdisplay sidebar sneaktime)
- Mount an entity (/ride or manually) and immediately dismount and keep holding the sneak button.
- Notice how the "sneak_time" scoreboard doesn't increment (or how the predicate doesn't return "true")
Sneakdetection inconsistencySneak Desync between Client and Server
What's supposed to happen:
Whenever the player model is sneaking, the is_sneaking predicate should return "true", and the "sneak_time" scoreboard should go up.
What happens instead:
In some scenarios, the predicate returns "false" even if the player sneaks.
How to reproduce:
- Either:
- Set up a datapack with an "is_sneaking" predicate, then place down a command block that checks for it
- or (recommended) set up a "sneak_time" scoreboard (/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time) and display it in the sidebar (/scoreboard objectives setdisplay sidebar sneaktime)
- Mount an entity (/ride or manually) and immediately dismount and keep holding the sneak button.
- Notice how the "sneak_time" scoreboard doesn't increment (or how the predicate doesn't return "true")
What's supposed to happen:
Whenever the player model is sneaking, the is_sneaking predicate should return "true", and the "sneak_time" scoreboard should go up.
What happens instead:
In some scenarios, the predicate returns "false" even if the player sneaks.
Edit: In fact, it's a desync between client and server. The server sees you stand normally, while clientside you're crouching.
How to reproduce:
- Either:
- Set up a datapack with an "is_sneaking" predicate, then place down a command block that checks for it
- or (recommended) set up a "sneak_time" scoreboard (/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time) and display it in the sidebar (/scoreboard objectives setdisplay sidebar sneaktime)
- Mount an entity (/ride or manually) and immediately dismount and keep holding the sneak button.
- Notice how the "sneak_time" scoreboard doesn't increment (or how the predicate doesn't return "true")
What's supposed to happen:
Whenever the player model is sneaking, the is_sneaking predicate should return "true", and the "sneak_time" scoreboard should go up.
What happens instead:In some scenarios, the predicate returns "false" even if the player sneaks.
Edit: In fact, it's a desync between client and server. The server sees you stand normally, while clientside you're crouching.
How to reproduce:
- Either:
- Set up a datapack with an "is_sneaking" predicate, then place down a command block that checks for it
- or (recommended) set up a "sneak_time" scoreboard (/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time) and display it in the sidebar (/scoreboard objectives setdisplay sidebar sneaktime)
- Mount an entity (/ride or manually) and immediately dismount and keep holding the sneak button.
- Notice how the "sneak_time" scoreboard doesn't increment (or how the predicate doesn't return "true")
Expected behaviour
Whenever the player model is sneaking, the is_sneaking predicate should return true, and the sneak_time scoreboard should go up.
Observed behaviour
In some scenarios, the predicate returns "false" even if the player sneaks. In particular, this happens when keeping shift held after dismounting an entity.
This indicates a desync between client and server. The server sees you stand normally, while client-side you're crouching.
Steps to reproduce
- Track sneaking time, using either (or both) of the following two options:
- Set up a "sneak_time" scoreboard:
/scoreboard objectives add sneaktime minecraft.custom:minecraft.sneak_time)and display it in the sidebar:
/scoreboard objectives setdisplay sidebar sneaktime- Set up a datapack with an is_sneaking predicate, then place down a command block that checks for it
- Mount an entity (/ride or manually; easiest is a boat). Immediately dismount and keep holding the sneak button.
- Notice how the sneak_time scoreboard doesn't increment (or how the predicate doesn't return true)
SneakDesync betweenClient andServerSneak desync between client and server
Would MC-268008 describe your issue?
I just tested it in multiplayer, and apparently the server things I'm standing. Other people don't see me sneaking at all.
Also, apparently performing this bug lets you clip into the floor. Tested with boats. Not sure if it happens for the same reasons though
Does MC-231283 describe your issue? To me, it seems like it does. While not explicitly stated in that issue, it describes the behavior of the 'is_sneaking' predicate not properly detecting a 'flying' (in your case, a player who is mid-air after getting off a horse).
MC-231283 does not describe the bug I'm describing.
My bugreport isn't about an inconsistency between the scoreboard and the predicate, but instead the fact that the setup I described puts you into a state where you're crouching client-side but not serverside (So neither the scoreboard OR the predicate trigger). I realised that after I made the bugreport, so the title I chose is misleading. I edited the title and made an extension in the bugreport to make it clearer.
To make this easier to reproduce, could you please attach a simple data pack for reproducing this? Thanks!
I sadly can't provide a datapack in the next few days, but the /tick command makes this trivial:
Confirmed; happens in 1.20.4 as well.
Confirmed in 1.21.4 Pre-Release 3