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

Players with modified Health attribute falsely die

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 20w20b
    • None
    • Issue present in singleplayer worlds and third-party servers
    • Unconfirmed
    • (Unassigned)

      When players have modified health attributes and take damage, they can falsely die.
      The player will see a respawn screen, despite still having health available.
      The issue is only perceived client-side, players in a server environment will not see that this has happened to another player; And reloading your world, or re-logging into a server will resolve the issue.

      The most reliable way to reproduce this is to set a players max health to a low value (/attribute @s minecraft:generic.max_health base set 6) and then splash the player with the poison effect (though I see this issue occur seemingly unpredictably with many other deaths, while the players health attribute is modified to a low value)

      As attached (first.png), player still has available health after being splashed with poison, but they see the respawn screen as if they have died

      then when they click respawn, they do not teleport to their spawn point, they do not lose their items, they just resume where they were (second.png)

      if the player looks at themselves in third-person or in the inventory, their player model is flickering red and leaning on an angle, as if they are dying (third.png)

      This issue seems to be caused by the players health bar not updating when the max health attribute is modified. Despite only having 3 available hearts in this scenario, the player still has 10 hearts worth of life. If the player takes any damage first (i.e. punched by another player) and is then splashed by poison, this bug will not occur, because their health is updated to their max health value after they take damage

      Suggested solution: Update the players current health to match their max health value when it is modified.

      To my knowledge, this bug has existed since at least 1.12, as seen hereĀ https://www.youtube.com/watch?v=yW3bkIgWHwY

        1. first.png
          first.png
          825 kB
        2. second.png
          second.png
          834 kB
        3. third.png
          third.png
          1.64 MB

            Unassigned Unassigned
            scoott Scott Gamble
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: