Wearing a pumpkin is more about just making you look awesome. Yet, it has other benefits which can help you fight a powerful foe. If you wear a Pumpkin, then Endermen will not attack you. Even if you attack them.
Endermen only attack those who make eye contact with them. However, the Pumpkin technically prevents you from making eye contact. So, they stick to their mantra and refuse to fight back. Such honorable foes.