Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-119183

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w22c, Minecraft 1.13.1
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                asanetargoss asanetargoss
              • Votes:
                3 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: