When a player puts on an item (in my case, a helmet) with a generic.maxHealth value of 0.x (Operation:1), then the player's health will increase to match. However, if the player then puts on an item with a generic.maxHealth value of 0.xx (less than the original) then the player's Health float value will only decrease to the next even float value up until the player takes sufficient damage to go below the intended value. (EDIT: this is what happens in 1.15.2. In 1.16.4, the float does not decrease at all.)
For example: if I put on a helmet with a generic.maxHealth value of 0.2, and then remove it, delete it, and place a new helmet on with a generic.maxHealth value of 0.05, then my Health value will stay at 24 (but I will have one full extra heart) until I take half a heart of damage, at which point it changes to 21.0. This is the case if the generic.maxHealth attributes on each piece have the same UUID and if they each have different UUIDs.
EDIT: To reproduce the bug (1.16.4):
/give @p leather_helmet{AttributeModifiers:[{AttributeName:"generic.max_health",Name:"generic.max_health",Amount:0.2,Operation:1,UUID:[I;702444554,1324106507,-1506023134,1861994455],Slot:"head"}]} 1
Place this on your head, then run:
data get entity @s Health
Then run this command:
/give @p leather_helmet{AttributeModifiers:[{AttributeName:"generic.max_health",Name:"generic.max_health",Amount:0.05,Operation:1,UUID:[I;-1594121462,1295467870,-1076869537,-1392330127],Slot:"head"}]} 1
Replace the old helm with the newly made one, then get your new player health. It will still say "24", despite visually being 22. Even then, the intended value should be 21.
Running `effect give @s instant_damage 1 0 true` corrects the health value.
Linked issues
duplicates 1
Attachments
Comments 2

Thank you for your report!
We're tracking this issue in MC-180001, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit
Please provide instructions for reproducing this with exact commands