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

Mobs look at invisible mobs / players


    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 19w08a
    • Minecraft 1.11.2, Minecraft 17w18b, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 1.13.2, Minecraft 18w43c, Minecraft 19w06a
    • Confirmed

      The bug

      Mobs look at invisible players or other mobs even if they are not on the same team or the team option seeFriendlyInvisibles is disabled.

      How to reproduce

      1. Summon an invisible villager
        /summon villager ~ ~ ~ {ActiveEffects:[{Id:14b,Amplifier:0b,Duration:1200,ShowParticles:0b}]}
      2. Summon a second villager
      3. Switch to Spectator mode to make sure they are not looking at you

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The methods net.minecraft.entity.ai.EntityAIWatchClosest.shouldExecute() and net.minecraft.entity.ai.EntityAIWatchClosest.continueExecuting() ignore whether or not the entity is invisible.

        1. 1.png
          184 kB
          efraim bring
        2. 2.png
          235 kB
          efraim bring
        3. 3.png
          245 kB
          efraim bring
        4. Villager looking at invisible villager (17w18b).png
          205 kB
          [Mod] Marcono1234

            jeb [Mojang] Jeb (Jens Bergensten)
            nisse26a efraim bring
            3 Vote for this issue
            2 Start watching this issue