execute at @s run function endermen/ender_lord/find_target

tag @e[family=player,tag=EndermanLordTarget] add EndermanLordDamage
tag @e[family=snowgolem,tag=EndermanLordTarget] add EndermanLordDamage
tag @e[family=irongolem,tag=EndermanLordTarget] add EndermanLordDamage
tag @e[family=villager,tag=EndermanLordTarget] add EndermanLordDamage
tag @e[family=wandering_trader,tag=EndermanLordTarget] add EndermanLordDamage
tag @e remove EndermanLordTarget

execute as @e[c=1,type=ldz:ender_lord] run damage @e[tag=EndermanLordDamage] 9 entity_attack
tag @e remove EndermanLordDamage