Description/summary
When entering a world where you are in creative, but have previously been in survival and taken damage, upon entering survival mode your health will show as 20, despite being another value. Placing a block will then update the health to the correct value.
Steps to recreate
Enter a world. Gamemode doesn't matter.
Enter survival mode and take damage.
Enter creative mode
Exit the world
Enter it again.
Go into survival mode
Place a block
Observe the health bar suddenly change
Any Variables
Seed doesn't seem to be a factor.
If the worlds default gamemode is survival, then placing a block will not update your health, though it will still show as 20. You will need to take damage to update it.
Right clicking seems to work to update it as well [Tested in 1.21.50.26 preview (my launcher is bugged, unable to update bedrock + preview)]
Affects Realms, though its difficult to get health to update by placing a block.
Video
Can confirm in 1.20~1.21 and it‘s a very common issue.