The bug
A player will suffocate when touching a solid block while swimming.
Related issues
is duplicated by
relates to
Attachments
Comments


Still an issue in 18w20a

Affects 18w20b

Affects 20c.

Affects 18w21b

The reason this happens is when you're swimming, your eye height goes outside the hitbox.

Confirmed for 18w22a. For me, this bug happens when you swim upwards in a 1x1 tunnel.

Confirmed for 1.13-pre1

Just adding some details from the duplicates:
Happens pretty much any time the player attempts to swim up from under a 1-block high space, or when swimming near a "ceiling" (any solid blocks close overhead) underwater.

Confirmed for MC 1.13-pre1
This bugs appears when you touch a block while swimming. This is due to the player's hitbox. When you get touched, you are "attacking" your hitbox. Also happens when you sprint in a 1-high space as Rat Dog said.

Affects 1.13-pre5!