Iron golems will occasionally attack creepers, causing them to explode. The golem will then continue to try and attack the space where the creeper was. Unloading the chunk will fix their behavior. The golem is probably not 'receiving credit' for the kill when the creeper explodes, so they continue to attack.
This behavior applies to all mobs with the "new" AI that are capable of attacking (skeletons, zombies, wolves, witches). Basically in an infight if one mob dies the "killer" will still try to attack the empty spot where the mob died.
Related issues
is duplicated by
Attachments
Comments

Strange. 1.4.2 change log indicates:
Iron Golems
Now attack creepers, Slimes and Magma Cubes
Attached couple of screenshots where I couldnt get them attacking creepers at all, yet they go to town on spiders and slimes.
Ok, update. Spawned a magma cube next to iron golem, which it hit as expected, it then turned around and walloped one of the creepers it had previously ignored.
Definitely inconsistent behaviour.
I have also seen the iron golems kill a zombie and then get stuck swinging the air over the place where the zombie died until I relogged (=reloaded the chunk). So it seems to be a bug where the iron golem somehow does not 'get notified' that the mob actually died already.
Same here. Iron Golem swings arms but there is nothing to hit
happened to me too, my iron golem stared at a creeper for 5 mins then it attacked it causing the creeper to blow up, then the iron golem attacked the spot where the creeper used to be.
Dinnerbone and Jeb said at an earlier point in time that they fixed this bug--the real thing is, though, that (I think) they merely reduced the frequency of it happening by 80-90%. (This was probably unintentional....)
Recently, I accidentally hit an Iron Golem in the head, while it was standing idly right next to a Creeper; but at the exact moment I did that, the Iron Golem attacked the Creeper. (Unfortunately, I couldn't get a screenshot in time....)
still present in 1.4.6 pre release. the iron golem kept attacking a place where he had previously killed an endermen
Yeah, I made a Enderman fight a Iron golem in the 1.4.6 Pre-release and when he killed the Enderman the iron Golem was attacking no one.
Thanks to MC-5159 found out this behavior applies to all mobs with the "new" AI. Updated summary and description to reflect that.
Does this issue also cover Iron Golems attacking players but having no effect (ie. the player is alive and stood next to the golem, it does the attack animation, but nothing happens).
If you build a snow golem and make it throw a snowball at a iron golem, after the iron golem has killed the snow golem it will stand where the golem died, flailing its arms.
Are you guys ever going to fix their behavior? Just wondering, because they were not fixed in 13w01b, and that snapshot was for bug fixes.
I also saw this on 1.4.7, on an SMP server! (I didn't think to take a picture of it, though. Sorry....) I've also seen this bug occur on Survival mode (namely, on that same server) AND without mob griefing disabled.
Here is an example of this bug: http://www.youtube.com/watch?feature=player_detailpage&v=3rsYIMzcBPE#t=1472s
looks like garbage collectors are a pain in the ass 😉
With this new update, 1.5.1, golums and skeletons will both continue attacking the area their enemy was after they have killed it. This didn't happen to me before in any other updates, but I see it's not uncommon.
still happens in 1.5.1. When it kills a snow golem, it randomly flings its arm in the air at random intervals.
I'd never seen this glitch before 1.5, now my iron golems are doing it basically every time they attack something =/
Just to confirm this is happening across two different clients/worlds for us. It started with 1.5, shock horror, golems stuck in the attack cycle will not do anything else even when attacked. Thus dying at the hands of skeletons.
I've noticed that if a skeleton kills you, if you don't click "Respawn" he will continue to shoot at the spot you died.
yup. that happens with another mobs to, firehunterx...
Still happens in 18w50a. I spawned an iron golem in The End. The iron golem attacked an endermen, then endermen teleported to the top of a pillar and the iron golem stayed at a certain distance from the pillar attacking the air forever.