Enderman attacks a player if he's looking at him.

It works and they don't attack if he has a pumpkin on his head :)
Me too. Didn't read the code properly.

Which still means the comment is weird, two people reading it wrong. Perhaps you should reword it: `Do not attack players if skylight is 7 or lower`.

And is that really the proper behavior? I would expect it exactly the opposite - only attack players when skylight is 7 or lower. This way endermen will never attack players inside caves, that doesn't feel right.