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.
Linked Issues
Created Issue:
Instant health potion kills player when health modifier brings health at or below 1E-46
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 1 0 {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 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-19.99999999999999,Operation:0,UUIDLeast:894654,UUIDMost:2872}]} /give @p diamond_chestplate 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894655,UUIDMost:2873}]} /give @p diamond_leggings 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894656,UUIDMost:2874}]} /give @p diamond_boots 1 0 {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.
Environment
Windows 10 Home 64 bit
Java 1.8.0_131 64 bit
relates to
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_helmet1 0{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 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-19.99999999999999,Operation:0,UUIDLeast:894654,UUIDMost:2872}]} /give @p diamond_chestplate1 0{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894655,UUIDMost:2873}]} /give @p diamond_leggings1 0{AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-0.99999999999999,Operation:2,UUIDLeast:894656,UUIDMost:2874}]} /give @p diamond_boots1 0{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.
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.
Windows 10 Home 64 bit
Java 1.8.0_131 64 bit
I would like to request ownership of this report as the owner has been inactive since July, 2017
So, this is not a duplicate of
MC-19690, but seemingly relates.I would like to request ownership as the owner has been inactive since July of 2017.
I was unable to reproduce this issue in 22w03a. Is this still an issue?
I cannot reproduce this in 1.18.1. Might have been fixed with
MC-19690