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
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
Hit the mob in creative mode
Quickly switch to survival mode (must be 4 seconds or less)
→ ❌ The mob begins to pursue the player
Linked issues
relates to 1
Attachments
Comments 17
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.
This is actually related to my old bug report MC-159532 which was marked as WAI by slicedlime
I tried this and I can confirm that there's a small delay of 5-6 seconds until it doesn't agro you.