The bug
Zombies, husks, pillagers, illager beasts, and vindicators can attack invisible villagers and wandering traders (making wandering traders drinking an invisible potion pointless), this should not happen.
How to reproduce
Summon an invisible villager.
/summon minecraft:villager ~ ~ ~ {ActiveEffects:[{Id:14,Duration:10000,Amplifier:0,ShowParticles:0b}]}
Spawn a zombie.
→ ❌ The zombie attacks the invisible villager.
Linked issues
is duplicated by 3
Comments 6
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.
For a detailed description of this issue occurring with wandering traders and without using commands, see MC-143804
I could not test this for the wandering trader (as the zombies didn't seem to bother no matter whether it is visible or not), but for villagers it seems to be fixed (unless there are zombies that already saw the villager before it became invisible; those will continue to follow it)
Edit: Tested again, and now the zombies noticed the wandering trader when it was visible, and didn't when it wasn't. Confirmed to be fixed.
Confirmed for 1.8.3. You may also add to the description that this also works with a splash potion of invisibility on a villager.