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 15
Attachments
Comments 21
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.
It happens specifically when having previously attacked with a sprint-knockback attack, not just any attack, and the player must continue sprinting/swimming for the state to continue. This issue also allows players to critical hit while sprinting, where a sprint-knockback attack would ordinarily be performed instead.
Because of this, it may be desirable when fixing this to intentionally program the critical hit functionality to avoid severe PvP implications. Meaning, attacking with a sprint-knockback attack would still let all successive hits be critical hits for the duration of that sprint.
Also note that this issue breaks the attacking hitbox of spears. If you attack while swiming underwater, the hitbox of mobs becomes completely displaced when attacking with a spear, where you have to attack above their hitbox or the attack always whiffs.
Also this is the same bug as https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-69459
Can confirm both cases.
Edit; Version is 1.17 Prerelease 3