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

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

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