mojira.dev
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 @unknown can be found in this comment.

Linked issues

Attachments

Comments 32

can confirm bug exists in 15w39c on OSX 10.10 java 1.8

Logical_Cyclops

I think this is intended? I mean sure it makes no sense why it would be but it just is, I could be wrong though.

still present in 15w42a

I believe intended behavior is for provoked mobs to track you as normal, the being able to see you regardless of potion effect seems like the bug portion of this report.

Daniel Goerner

Confirmed for 16w04a

Looks like Magma Cubes are not ignored anymore in 1.10-pre1. Can anyone confirm?

22 more comments

Also affected by hoglins in 1.16 snapshots.

Hoglins are covered by MC-172479.

I think the bug has been fixed at some point.

It is intentional that mobs can sometimes see invisible players up to a distance of 3.5 metres (or even further if the player is wearing armor).

It is intentional that mobs (except slimes) who are attacked by invisible players can see their attacker and fight back.

Many players thinking a return of MC-89309

gaspoweredpick

I think remaining issues with invisibility should have their own reports.

Kim Eckmann

(Unassigned)

Confirmed

Normal

Mob behaviour

attack, hostile-mobs, invisibility, player, potion

Minecraft 15w39b, Minecraft 15w39c, Minecraft 15w42a, Minecraft 16w04a, Minecraft 1.9 Pre-Release 2, ..., 20w18a, 20w19a, 20w20a, 20w20b, 20w21a

Retrieved