How to reproduce
Go to a ≥2 block deep body of water
Wait until underwater area is visible (theoretically easier with night vision and water breathing)
When underwater area is visible, leave the world
Re-enter the world
Underwater visibility should remain when logging back into a world (at least that's what I expected).
Code analysis
Code analysis by @unknown can be found in this comment.
Attachments
Comments 11
Code analysis
This is because getUnderwaterInvisibility (yarn 1.18.2) is present in ClientPlayerEntity not PlayerEntity and cannot be saved in NBT.
Can confirm in 20w49a.