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

Health doesn't update server-side when max health is reduced

    XMLWordPrintable

Details

    • Icon: Bug 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

      1. Create a health scoreboard
        /scoreboard objectives add Health health
        
      2. Set the scoreboard to display on the sidebar
        /scoreboard objectives setdisplay sidebar Health
        
      3. Switch to Survival mode
        /gamemode survival
        
      4. 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"'}}
        
      5. Give yourself regeneration so that the scoreboard updates and your Health is set to 60
        /effect give @s minecraft:regeneration 4 255
        
      6. Your Health score should now be 60
      7. 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

        1. health.png
          health.png
          88 kB
        2. MC-16345.mp4
          9.80 MB
        3. MC-16345.png
          MC-16345.png
          1.37 MB

        Activity

          People

            Unassigned Unassigned
            RichardBrazil Richard de Souza Bukor
            Votes:
            40 Vote for this issue
            Watchers:
            16 Start watching this issue

            Dates

              Created:
              Updated:
              CHK: