Helper Note
Please restrict comments to new info that might help to fix this bug. Discussion how this bug can be abused can take place elsewhere.
And remember: It is a bug. Please don't get too upset when it gets fixed.
The bug
Using a teleport command to get out of water while in the swimming animation causes it to be stuck. The player swims on land and is not able to toggle it off.
This also happens sometimes when you jump out of water.
How to reproduce
Setup a commandblock with the following command. Add repeaters to it so you have delay after activation
/tp @p (location outside of the water)
Activate the contraption
Get into a pool of water (at least two blocks deep) and press
Shift
to enter swimming mode
You are teleported while you're swimming, causing you to continue the swimming animation. Upon re-entering water the swimming animation gets deactivated.
Related issues
is duplicated by
Attachments
Comments


Does it also happen for you when just swimming out of water, like when you put a water source on flat ground and swim out of the area?

I've tested this, and from what i can tell, to reproduce this, you need to swim in a 2 block high water space (to start swimming), swim into a one block high area, then climb out of the water. Works every time

Confirmed in 1.13-pre4. It also happens when trying to right-click to get into a boat when you're in swim mode. You enter the boat, but you're still in swim mode.

I still have this bug. When an iron door closes on my (I stand in the path of the door and then the door closes) it switches me to swimming.

On your what?