mojira.dev
MC-154228

Ghost Health is created when having negative maxHealth attributes

How to recreate:

  1. Have a health scoreboard, /scoreboard objectives add health health

  2. Give yourself a item with negative MaxHealth, /replaceitem entity @s armor.head minecraft:leather_helmet{AttributeModifiers:[{AttrbuteName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-2,Operation:0,UUIDLeast:137757,UUIDMost:964305,Slot:"head"}}{{}]} 1{{}}{{}}

  3. You see that the health score dosn't go down or updates even when you regenrate or having some absorption

  4. When you clear the helmet the health goes back to your original health

Linked issues

Attachments

Comments 3

HalbFettKäse

The maxHealth attribute only changes the amount of HP you are able to regenerate to. So when you set that to something lower than your current HP, the game will not remove anything as this isn't what the maxHealth attribute does.

Damaging the player by 2 HP will in this case resolve the issue and the player would not regenerate to anything above 18 HP.

megaspark2a

But it should damage the player cause if it don't damage the player he is able to have more hearts than the maxHealth attribute is allowing to have.

violine1101

Duplicate of MC-16345; see also MC-180001

megaspark2a

(Unassigned)

Unconfirmed

(Unassigned)

Minecraft 1.14.2, 1.14.4, 19w45b

Retrieved