Mojira Archive
MC-119183

Instant health potion kills player when health modifier brings health at or below 1E-46

The bug

In the simpler case, wearing armor that brings max health to 0 after modifiers causes a player to die when receiving the instant health potion effect, possibly detrimental to mapmakers. Example command given below:

/give @p diamond_helmet{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-20,Operation:0,UUIDLeast:894653,UUIDMost:2871}]}

In fact, a health value of zero is not necessary for this to occur. A max health value as high as 1E-46 can lead to death. Commands for a relevant armor set given below:

/give @p diamond_helmet{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-19.99999999999999,Operation:0,UUIDLeast:894654,UUIDMost:2872}]}
/give @p diamond_chestplate{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894655,UUIDMost:2873}]}
/give @p diamond_leggings{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894656,UUIDMost:2874}]}
/give @p diamond_boots{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.9999,Operation:2,UUIDLeast:894657,UUIDMost:2875}]}

Removing the final trailing 9 from the last modifier brings the final max health up to 1E-45. The player will not die when drinking a health potion in this state.

Please note that this bug report refers to a server-side player death, not to be confused with "fake" client-side deaths which may also occur under similar conditions.

Cannot Reproduce

asanetargoss

2017-07-04, 02:32 AM

2022-02-28, 03:08 PM

2022-02-28, 03:08 PM

4

5

Confirmed

(Unassigned)

Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w22c, Minecraft 1.13.1

-