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

Mobs with an attack damage of 0 can still cause hit ticks on non-player entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.4
    • None
    • Community Consensus
    • Commands, Mob behaviour
    • Low
    • Platform

      The Bug
      Mobs with an attack damage of 0 will still attempt to attack their target. When targeting a player, it is unable to cause any hit ticks at all. However, when hitting a non-player entity (such as an iron golem), it will still cause that mob to flash red and have a hurting sound, despite taking no damage.

      To Reproduce
      Summon a husk or any hostile mob that uses melee attacks with an attack damage of 0, and any mob that this hostile mob would attack. Observe that it can still give it hit ticks, but it will not deal any damage. Let the hostile mob try to attack you. Observe that it does not give any hit ticks.

      Commands:
      Summon a husk with an attack damage of 0 and resistance so it won't die:

      /summon husk ~ ~ ~ {active_effects:[{id:"minecraft:resistance",amplifier:5,duration:-1}],attributes:[{id:"minecraft:generic.attack_damage",base:0}]}
      

      And summon an iron golem for the husk to attack:

      /summon iron_golem ~ ~ ~
      

      And let the husk attack the iron golem

            Unassigned Unassigned
            Xanbelor Xanbelor
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: