Mojira Archive
MC-89309

Potion of invisibility doesn't prevent mobs from attacking a player

The bug

When a player, while wearing no armor, affected with the Invisibility effect, hostile mobs will still target and attack the player as normal.

In /gamemode survival the following mobs will attack the player:

  • Unprovoked: Guardians, Elder Guardians, Blazes, Ghasts, Wither Bosses, Phantom, Shulkers
  • Provoked (hit): Creepers, Skeletons, Zombies, Spiders, Cave Spiders, Silverfish, Endermites, Endermen (not when looked at, but when hit), Zombie Pigmen, Wither Skeletons, Shulkers (stops attacking after a bit)
  • Ignore you even when provoked: Slimes and Magma Cubes

Have even seen some mobs, under some circumstances trying to attack while in /gamemode creative or /gamemode spectator, while affected with the Invisibility effect. However not always.

Code analysis

Code analysis by [Mojang] Gnembon can be found in this comment.