mojira.dev
MC-220390

Players can get stuck when attempting to swim under blocks after having previously attacked an entity

The bug

If you hit an entity while swimming underwater, the player will stop swimming for a brief moment (it changes the size of its hitbox and returns to the swimming one) and then get stuck in the middle of the water if they try to swim below a block (the player gets stuck when their large hitbox collides with a block, even if they are using a different size hitbox).

How to Reproduce:

  1. Go to an aquifer (flooded cave)

  2. Underwater, spawn an entity:

    /summon minecraft:drowned ~ ~ ~ {NoAI:1b,NoGravity:1b,PersistenceRequired:1b}
  1. Swim holding W + Ctrl (don't release these keys)

  2. Hit the entity (you will see that it stops swimming for a moment)

  3. Try to reach the ceiling of the cave.
    ❌   You will get stuck a block away from the ceiling.

If you stop swimming, it will work normally again.

You can also reproduce this in third person with the hitboxes turned on (F3 + b), and you will see the quick hitbox change that it does when hitting the entity. Watch

[media]

 to understand this better.

 

Relates to MC-69459.
Possible side effects of fixing this mentioned in this comment.

 
The bug can also be triggered when exiting the water in certain circumstances (if there is one block of air between the roof and the water and a block next to where the player comes out) and can cause damage to the player when colliding with a block. (

[media]

)
*Moved to MC-234665{}
**Now on MC-233582

Linked issues

MC-128846 Players can get stuck in their position and constantly jitter when attempting to swim through small spaces after having previously attacked an entity while swimming MC-192536 I get stuck in water when I swim inside the water temples MC-196151 I get stuck on/in blocks that I swim into MC-208762 Guardians freeze you in place sometimes MC-261501 stabbing a fish while swimming bugs you out surfacing if under an ice lake. MC-263305 player freezes after catching a fish and swim into glowing blocks(glowblock,torch) MC-264173 Fast Swimming Ceiling Glitch MC-273384 Freezing in place swimming after sprint attacking MC-273575 swimming under ice sometimes locks me in place MC-277194 Player freezes when sprint-swimming underneath a block MC-279066 If player swimming and any mob will hurt him in close combat, he will not be able to swim into holes below 3 blocks

Attachments

Comments

migrated

Can confirm both cases.

 

Edit; Version is 1.17 Prerelease 3

SeaOfPixels

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.

SeaOfPixels

Can confirm in 23w12a

Avoma

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.

SeaOfPixels

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.

COMETC2021A1

Confirmed in 1.20.6 and 24w19b.

diskria

Can we hope that this will be fixed in 1.21?

rkullenius

Are you still able to reproduce this on the newest version?

diskria

Confirmed in 1.21.3 and 24w45a

[Mod] ManosSef

@unknown, 24w45a is outdated. Can you reproduce this in 24w46a?

diskria

Ah yes today is thursday! Yes, just tested now, it reproduced in 24w46a

diskria

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

SeaOfPixels

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.

Lyoneer

Can you send a video of when you reproduced this?

diskria

Yes, i uploaded it to imgur: https://imgur.com/a/w7eFlUN

knirch

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 (

[media]

) 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.

SoloAlguien

(Unassigned)

Confirmed

Platform

Important

Hitboxes, Networking, Player

client-side, hitbox, player, server-side, swim

Minecraft 18w16a, 1.16.1, 1.16.4, 20w51a, 1.16.5, ..., 1.21.1, 24w40a, 1.21.3, 24w46a, 1.21.4

Retrieved