The bug
Iron golems will occasionally attack the player after they have switched to creative/spectator mode by using F3+N, they will also follow the player and still occasionally attack them.
How to reproduce
/summon iron_golem ~ ~ ~ {PlayerCreated:0}
Attack a villager near the golem
If the golem sees you, do F3+N
The iron golem will follow the player in creative/spectator and will swing their arms.
Note: It is required to attack villagers until the golem is hostile, because attacking the golem rather than the villagers will not trigger the bug.
Linked issues
is duplicated by 1
relates to 2
Attachments
Comments 4
Updated
[media]to see the process. The villager nearby has a gossip "minor_negative" of 125 towards the player. As we switch to survival, the golem is attacking us. As we switch back to creative, the golem does not attack the same way, but we can see he is walking around its target, even when on spectator, and sometimes hit "the air".
Additional information: If you are too far away from the golem (after the villager has a gossip "minor_negative"), the golem will not move but will slightly move and repeats this behavior. Also, going near 11 blocks of where the golem is, it will start walking around again.
MC-146524 should linked to here as a related issue.