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

Mobs of same type can attack from any distance when aggravated


    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.2
    • None
    • openjdk 17.0.4 2022-07-19
    • Unconfirmed
    • (Unassigned)

      when a mob is aggravated towards another from the same type (e.g. from a custom snowball with mob2's UUID as Owner), the mob1 can attack the mob2 from any distance.
      This is not consistent for all mobs, but it only does that when both are of the same type.
      I have tested it from versions 1.16.5 to 1.19.2, and it always has this effect.

      Steps to Reproduce:

      1. place 2 mobs in containment, many blocks apart.
      2. summon an arrow  onto a block above mob1
      3. merge mob2's UUID as the owner of the arrow
      4. break the block under the arrow, allowing it to hit mob1

      mob1 will then attack mob2 even if they are multiple blocks apart

      Observed Results:

      mob1 will attack mob2, even though they are out of range

      Here are the results of my tests: (yes: any range attack; no: tries to attack normally; none: does not try to attack at all)

      • husks: yes
      • blazes: yes
      • zombies: yes
      • skeletons: no
      • wither skeletons: no
      • husk + blaze: no
      • zombie villagers: yes
      • pillagers: none
      • piglins: none
      • pillager + husk: no
      • skeleton + zombie: no
      • zombie + skeleton: no


      Expected Results:

      The mobs should attempt to pathfind and only attack when in range.



      Demonstration of the test with a snowball, 1.19.2



      This mostly only affects datapack development, although it is simply just not supposed to happen and may cause future issues with implementing ranged mobs.

      When/if someone starts looking into what code causes this issue, I've noted that it seems that mobs that have the ability to wield ranged weapons are the ones who work properly.

      I couldn't figure out how to put more versions in but I have tested the bug from 1.16.5 to 1.19.2 and it happens in all those versions

            Unassigned Unassigned
            superwibr superwibr
            0 Vote for this issue
            1 Start watching this issue