mojira.dev
MC-199589

Hitting mobs in Creative then switching into Survival causes the mob to target you

The bug

Hitting a mob (which is by default passive; or which does not see you because you are invisible) in Creative mode and switching shortly afterwards into Survival mode makes the mob attack you.

How to reproduce

  1. Spawn a mob (preferably passive, you also can use hostile mobs for this, but you must be invisible), e.g. an Enderman, Polar Bear or Zombified Piglin

  2. Hit the mob in creative mode

  3. Quickly switch to survival mode (must be 4 seconds or less)
    → ❌ The mob begins to pursue the player

Linked issues

Attachments

Comments 17

I tried this and I can confirm that there's a small delay of 5-6 seconds until it doesn't agro you.

Thanks for creating the separate report, I have slightly changed the summary and description. I hope you are alright with that.

The more edits, the better. Thank you for the edits as that can help me with making the best bug reports possible.

Can confirm in 21w03a.

Can confirm in 21w08b. Video attached.

7 more comments

Can confirm in 1.18 and 1.18.1 Pre-release 1.

Can confirm in 1.18.2.

In 23w33a

This is actually related to my old bug report MC-159532 which was marked as WAI by slicedlime

I'm not sure if the resolution is accurate though. I don't think it's a desirable outcome that when you change from creative to survival the mob attacks you.

user-189af

CallMeChris

(Unassigned)

Confirmed

Mob behaviour

1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, ..., 1.20.2, 23w42a, 1.20.4, 1.20.5 Pre-Release 1, 1.21

Retrieved