Mobs look at invisible mobs / players
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
- Summon an invisible villager
/summon villager ~ ~ ~ {ActiveEffects:[{Id:14b,Amplifier:0b,Duration:1200,ShowParticles:0b}]} - Summon a second villager
- 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.
[Mojang] Jeb (Jens Bergensten)
2017-05-03, 09:26 PM
2020-06-12, 08:40 PM
2019-02-20, 02:54 PM
3
2
invisible, looking, mob, player