The bug
Iron golems no longer aggressively seek out dangerous mobs near its village unless attacked. It does work to an extent still however. Any time between immediately and after a long pause, the iron golem will attack the mob(s), but by that time it can be too late for a villager.
How to reproduce
You simply need a village capable of spawning an iron golem. After nightfall you can notice it seems "unaware" of many of the hostile mobs until they have been nearby for a short time.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 16
Attachments
Comments 17
Confirmed for 15w45a
Iron Golem's AI is very slow.
Players create the Iron Golem also have this issue.
I made an iron golem, and they do ignore any mob that comes near them, until you attack it, and then they will attack it. It seems rarely it will attack something on it's own, probably because that mob attacked the golem.
I am glad to see that this issue has been noticed and tracked. Yet it has been a long time since the bug was reported. I do not know what kind of cooperation this website has with Mojang, but does anyone know what kind of progress has been made towards fixing this?
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
It looks like the path finding of the iron golems has often problems, when the zombie are standing under roofs or on stairs (method net.minecraft.pathfinding.PathNavigate.getPathToPos(BlockPos)
), which might happen because of the larger hitbox of the iron golem.
Keep in mind, that iron golems have by default only a follow range of 16 blocks and can only move in 0.6 times the village radius away from the village center if there is a village nearby.
Confirmed in 1.8.1-pre3.