Jake Remmert
- Jake_Remmert
- jake_remmert
- America/Chicago
- Yes
- No
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.
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 HealthThen 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.
Player max health won't decreaseto odd float valuesfrom generic.maxHealth on itemsPlayer max health float values won't decrease from generic.maxHealth on items
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 HealthThen 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.



Sorry, duplicate of MC-48747
good to know i'm not alone here--i was extremely frustrated when the issue persisted after reinstalling all of Minecraft twice. i'd like to echo Marty's question: why on Earth has the pack format been changed for a minor update? we typically see pack formats last through several major updates, this is very out of place and annoying for creators.