I think the best way to do so is with entitytargetevent and the entity is an enderman and the target is player