Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-173179

Mobs with "min" health taking fatal damage get permanently broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.20.21 Preview, 1.21.70.22 Preview
    • None
    • Confirmed
    • Windows
    • 1075534

      The bug

      The min field in the minecraft:health component can be used to ensure a mob can never go below a certain amount of health. Indeed, mobs like this at minimum health are invincible to damage up to and excluding that amount. It can still be hurt, but its health won't go down. And of course it can be healed as normal.
      However, if the mob receives damage equal to or greater than its minimum health, it breaks. The mob is no longer able to be hurt or healed. It is permanently broken.

      How to reproduce

      1. Download and open the attached world. It contains a pig with minimum health set to 5.
      2. Punch the pig as many times as you want. It will never die, since its health can't go below 5.
      3. Now hit the pig with the diamond sword.

      Expected behavior
      Same as punching: the pig gets hurt, but its health can't go below 5.

      Observed behavior
      The pig makes the death sound, but drops no loot. It starts ignoring all subsequent attacks of any kind. Healing it makes no difference. It's permanently broken. A cursory glance at the mob's NBT (when exported in a structure block) reveals that its Dead tag is wrongly set to 1.

            tryashtar [Mod] tryashtar
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: