Details
-
Bug
-
Resolution: Unresolved
-
None
-
Snapshot 13w21a, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03a, Minecraft 14w03b, Minecraft 1.7.10, Minecraft 14w30c, Minecraft 14w31a, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34c, Minecraft 14w34d, Minecraft 1.8-pre1, Minecraft 1.8.2-pre4, Minecraft 1.8.8, Minecraft 15w37a, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12.2, Minecraft 18w15a, Minecraft 1.13.1, Minecraft 1.14.2, 1.14.4, 19w45b, 1.15.2, 20w21a, 1.16.1, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2, 20w51a, 21w03a, 21w05b, 21w06a, 21w07a, 21w11a, 21w14a, 21w15a, 21w16a, 21w17a, 1.17, 1.17.1, 21w43a, 1.18, 1.18.1, 1.18.2, 22w18a, 1.19, 1.19.2, 1.19.3 Release Candidate 3, 1.19.3, 23w18a
-
Confirmed
-
Survival
-
Data Packs
-
Low
Description
The bug
When max health is reduced (e.g. when you wear or hold an item which increases your maximum health with the generic.max_health attribute modifier, and then stop wearing or holding that item), your maximum health value is adjusted, but your current health value is not.
It can therefore happen that health > max health.
Reproduction steps
- Create a health scoreboard
/scoreboard objectives add Health health
- Set the scoreboard to display on the sidebar
/scoreboard objectives setdisplay sidebar Health
- Switch to Survival mode
/gamemode survival
- Give yourself an item with the generic.max_health attribute and select it
/give @s dirt{AttributeModifiers:[{AttributeName:"minecraft:generic.max_health",Name:"Health boost",Amount:40,Operation:0,UUID:[I;0,1111,0,111112]}],display:{Name:'"Health boost"'}}
- Give yourself regeneration so that the scoreboard updates and your Health is set to 60
/effect give @s minecraft:regeneration 4 255
- Your Health score should now be 60
- Now deselect the item
→Notice how your Health score is still 60.
The game will change your health back to 20 as soon as you get damaged, but does NOT reduce your health lower than 20 because of the damage.
If the difference between max health and health is large (e.g. above 20 in this case), you die instantly ("You Died!" screen appears) but are not actually dead yet, see also MC-19690.
Attachments
Issue Links
- is duplicated by
-
MC-18965 Switching from or to items that change maxhealth do not update health until damage is taken
- Resolved
-
MC-19688 Max Health Attribute Does Not Automaticly Update
- Resolved
-
MC-28127 Health doesnt update with negative maxhealth
- Resolved
-
MC-55117 Scoreboard health/ atributted skull bug
- Resolved
-
MC-67856 .maxHealth doesn't reset health
- Resolved
-
MC-81307 Health Boost from AttributeName:generic.maxHealth having wrong amount.
- Resolved
-
MC-154228 Ghost Health is created when having negative maxHealth attributes
- Resolved
-
MC-199741 /attribute hearts don't visually update until relog
- Resolved
-
MC-240209 max hp remove bug
- Resolved
- relates to
-
MC-180001 Reducing max health using /attribute does not reduce current health
- Open
-
MC-19690 Reducing maxHealth / max_health can cause fake death
- Resolved
-
MC-64311 Attribute (Bug?)
- Resolved