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

execute as @s at @s unless score @s petID = @e[r=2.0,c=1,type=!projectile:dirtthrow] petID positioned ^^^1.5 run scoreboard players set @e[r=2.0,rm=0.5,scores={block=0,parry=0},tag=!iframes,tag=!stunImmune] stun 20
execute as @s at @s unless score @s petID = @e[r=2.0,c=1,type=!projectile:dirtthrow] petID positioned ^^^1.5 run scoreboard players remove @e[r=2.0,rm=0.5,scores={block=0,parry=0},tag=!iframes] emotionP 1

execute as @s[tag=!projectileHit,scores={timer=0}] at @s unless blocks ^0.5^0.5^1.5 ^-0.5^-0.5^1.5 ~~~ all run event entity @s hit