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

Reducing maxHealth / max_health can cause fake death



    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.17 Pre-release 1
    • Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 13w39b, Minecraft 14w20b, 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-pre2, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.3, Minecraft 15w44b, Minecraft 15w46a, Minecraft 1.8.9, Minecraft 16w02a, Minecraft 16w03a, Minecraft 16w06a, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w15b, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w42a, 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, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 18w15a, Minecraft 1.13-pre7, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 1.14.1, 1.14.4, 19w42a, 1.15.2, 20w06a, 20w17a, 20w18a, 20w19a, 20w20b, 20w22a, 1.16 Pre-release 2, 1.16.1, 20w27a, 20w29a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2, 1.16.3, 1.16.4 Release Candidate 1, 1.16.4, 20w51a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w10a, 21w11a, 21w14a, 21w17a
    • Confirmed
    • Player
    • Normal


      It's possible to have higher maximum health than actual health (see MC-16345) because the helth doesn't adequately update server-side when an attribute stops being applied.

      In this state, when the player takes more damage than its max health, the client will show the death screen. However, since the maximum health has not actually been updated yet on the server side, the player doesn't die server-side. When the player then clicks "Respawn", the game continues as if the player hadn't died.

      This is a client-server desync where on the client-side, the player dies, but server-side, it doesn't.

      To reproduce

      1. Place a wither rose
      2. Switch into survival mode
      3. Give yourself this item:
        /give @p dirt{AttributeModifiers:[{AttributeName:"generic.max_health",Name:"generic.max_health",Amount:20d,Operation:0,UUID:[I;0,1,2,3],Slot:"mainhand"}]}
      4. Select the dirt block
      5. Run this command to fill your health:
        /effect give @p minecraft:instant_health 1 3
      6. Deselect the dirt block
      7. Walk into the wither rose
        You die immediately (because the server sends to the client "decrease health by 20 because max health changed")
        On the death screen, you continue to take damage
      8. Click "Respawn"
        You don't respawn, but are still at the same location as if nothing happened

      These actions can also cause this bug from being triggered, apart from being damaged by a wither rose:

      • Instant health effect
      • Instant damage effect
      • Poison effect
      • Suffocation
      • Drowning
      • Starvation (Hunger)
      • Hitting a wall with elytra


        1. 2013-06-28_20.52.50.png
          576 kB
          Daniel Goodman
        2. 2013-06-28_21.29.51.png
          677 kB
          Daniel Goodman
        3. 2013-06-28_21.29.52_2.png
          739 kB
          Daniel Goodman
        4. 2013-06-28_21.29.52.png
          676 kB
          Daniel Goodman
        5. 2013-06-28_21.30.50.png
          337 kB
          Daniel Goodman
        6. 2016-04-01_16.05.10.png
          429 kB
          Bren Rado
        7. 2016-04-01_16.05.21.png
          284 kB
          Bren Rado
        8. 2016-04-01_16.05.27.png
          285 kB
          Bren Rado
        9. 2016-04-01_16.05.32.png
          277 kB
          Bren Rado
        10. 2016-04-01_16.05.34.png
          277 kB
          Bren Rado
        11. 2016-04-01_16.06.05.png
          395 kB
          Bren Rado
        12. 2016-04-01_16.07.50.png
          437 kB
          Bren Rado
        13. 2020-07-11_23.12.16.png
          609 kB
          nicolas rodriguez
        14. MC-19690.mp4
          6.84 MB
          [Helper] Avoma



            grum [Mojang] Grum (Erik Broes)
            Squirtdude Daniel Goodman
            106 Vote for this issue
            44 Start watching this issue