scoreboard players operation @s[scores={petID=0}] petID = @e[c=1,family=!misc,family=custom_mob] petID

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

execute as @e[type=!projectile:bowreproj,family=!misc,family=custom_mob,scores={block=0,parry=0}] at @s unless score @s petID = @e[r=3.0,c=1,type=projectile:bowreproj] petID if entity @e[r=3.0,type=projectile:bowreproj] run damage @s 25 projectile

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

execute as @s[tag=!projectileHit] at @s unless blocks ^0.5^0.5^0.5 ^-0.5^0.5^0.5 ~~~ all run event entity @s hit