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

We still need to check if there is a wall between the player and the enderman, but it works.
They don't attack if he has a pumpkin on his head :)
Endermen continue attacking even when a player looks away, I think, so their angered state is not reset.