Minecraft wiki entry for Defeating_the_ender_dragon, associated text: Until you have spawned your golems, you should wear a carved pumpkin to avoid the endermen. The best time to spawn them is when the dragon is resting on its perch, when it does not attack you or your golems. You should also spawn them to the sides, in case it releases the dragon's breath.