execute as @s at @s unless score @s petID = @e[r=0.5,c=1,type=!projectile:arrowv2] petID run scriptevent apply:projectile

execute as @e[type=!projectile:arrowv2,family=!misc,family=custom_mob,scores={block=0,parry=0},tag=!stunImmune] at @s unless score @s petID = @e[r=0.5,c=1,type=projectile:arrowv2] petID if entity @e[r=0.5,type=projectile:arrowv2] run scoreboard players add @s emotionP 1

execute as @s[tag=!projectileHit] at @s unless score @s petID = @e[r=0.5,c=1,type=!projectile:arrowv2] petID run execute as @e[r=0.5,type=!projectile:arrowv2,c=1] at @s run event entity @e[type=projectile:arrowv2,c=1,r=0.5] despawn