Minecraft wiki entry for Things_not_to_do, associated text: As the carved pumpkin severely impairs the player's vision, it may not be a good idea to wear it and fight the dragon head-on, even if it prevents endermen from attacking the player. However, if the player uses a resource pack, third-person view, or removes the GUI to remove the impaired view of the carved pumpkin, the player can see the entire screen, and endermen cannot become provoked by the player looking at them. If the player would rather use a diamond helmet and they are confident they can keep their crosshair away from the endermen, using a diamond or netherite helmet might be a better idea. On a Peaceful level of difficulty, this is not necessary.