The bug
If a player holds the sprint key to swim, hits an entity, and tries to swim under blocks without ever releasing sprint, they get stuck in place and jitter.
This is due to a client-server desync when the player attacks while holding the sprint key. When hitting an entity, the server thinks the player's hitbox reverts to its normal standing size, while the client continues swimming with a smaller hitbox. As a result, when the player tries to swim beneath a block, the server stops them due to the standing hitbox colliding with the block, while the client keeps trying to advance with the smaller swimming hitbox.
This bug occurs fairly often while fighting Guardians in the Ocean Monument, making it harder to experience the dungeon as intended.
Steps to reproduce
Get inside an Ocean Monument:
/locate structure minecraft:monumentIf needed, spawn an entity:
/summon minecraft:guardian ~ ~ ~ {NoAI:1b,NoGravity:1b,PersistenceRequired:1b}Swim by holding
Ctrl+W(don't release these keys).Hit the entity.
Try to reach the ceiling of the Ocean Monument.
Observed behavior
Player gets stuck a block away from the ceiling and jitters.
Expected behavior
Player would reach the ceiling.
Additional notes
Linked issues
is duplicated by 14
Attachments
Comments 16
Just going to detail something here, you can add it to the report if you want: the thing that causes this is if you continue holding ctrl after u hit something, you go into a state where you can sprint but the game thinks you're walking (so for example you can do critical hits while sprinting by doing this). This is a major component for PvP, so if this bug were to be fixed, it would need to be a fix that keeps the existing behavior while sprinting but just fixes it while swimming.
This is a direct product of MC-69459. Basically, because the server thinks that the player is no longer sprinting after hitting an entity, the player cannot swim through small spaces or under blocks causing them to constantly jitter. Fixing MC-69459 would very likely also fix this issue (MC-220390).
This ticket also relates to MC-129568.
Fixing MC-69459 messes with PvP, I suspect this is why it has not been fixed. I'm sure this swimming bug could be fixed without breaking the behavior for sprinting.
Btw, I’d like to add that this bug prevents players from fighting in the Ocean Monument, as they get stuck in water while the Guardian attacks them with its laser.
So the problem isn’t just situational; it directly affects gameplay in this structure and makes it harder to fully experience the dungeon as intended
I would like to reiterate that the fixing of MC-69459 to fix this bug would negatively effect PvP in a substantial way. The desync allows doing critical hits while sprinting by continuing to hold ctrl after connecting a sprint-knockback attack. This is a massive part of PvP and adds a lot of depth, removing the desync entirely would be a terrible change. The side effects of the desync, such as this bug, should really be the only things fixed.
Yes, i uploaded it to imgur: https://imgur.com/a/w7eFlUN
Simple way of showing it is to add a scoreboard with minecraft.custom:minecraft.swim_one_cm and observe that it stops ticking if you punch a mob while swimming.
Interestingly enough, if you via a datapack (
) give the player blindness and clear it roughly 2 ticks later, it will force the client and server to start agreeing again. Shame it seems only blindness fixes it, so not the most subtle workaround.
Can confirm both cases.
Edit; Version is 1.17 Prerelease 3