Minecraft wiki entry for Iron_Golem, associated text: Iron golems can also be found surrounding pillager outposts, confined inside dark oak cages. When freed, they can help the player by attacking any nearby pillagers. Pillagers do not attack iron golems in cages, although the iron golem can attack any pillagers that are one block near the cage, because iron golems can attack through a one-block wall.