#execute at @a[predicate=survivalplus:pumpkinhat] if entity @e[type=enderman,distance=..10] as @n[type=enderman] rotated as @s at @s positioned ~ ~2.5 ~ run function survivalplus:tools/endermansus/look
execute as @a[predicate=survivalplus:pumpkinhat] at @s if entity @e[type=enderman,distance=..2,predicate=survivalplus:10chance] run function survivalplus:tools/endermansus/remove