Minecraft wiki entry for Iron_Golem, associated text: If the mob is flung out of sight, the iron golem attacks the next mob that attacks it. Sometimes, the iron golem might attack the nearest hostile mob if they are in groups.