If a player is wearing a carved pumpkin on their head, endermen do not attack the player if they look at it. If a mob is wearing a carved pumpkin, this has no effect on the enderman's hostility. This is an inconsistency and should be fixed.
From this suggestion
According to the Minecraft Wiki Enderman are only hostile toward PLAYERS who look at them in the eyes, mobs have to physically attack them so I think this is invalid