
# -> Debug particles
#particle happy_villager ^ ^ ^2 0 0 0 0.0001 3 force @a
#particle happy_villager ^ ^ ^3.5 0 0 0 0.0001 3 force @a

# -> If spear hit an entity then operate accordingly
execute positioned ^ ^ ^2 \
    positioned ~-1.5 ~-1.5 ~-1.5 \
    if entity @n[type=!#overly_realistic:spear_cant_damage,tag=!OverlyRealistic.Player.TempPlayerThrewSpear,dx=2,dz=2,dy=2] \
    at @s run \
        function overly_realistic:general/spears/spear_hit_entity

execute unless score #or.spear_hit_success OverlyRealistic.General.ArbitraryData matches 1.. \
    positioned ^ ^ ^3.5 \
    positioned ~-1.5 ~-1.5 ~-1.5 \
    if entity @n[type=!#overly_realistic:spear_cant_damage,tag=!OverlyRealistic.Player.TempPlayerThrewSpear,dx=2,dz=2,dy=2] \
    at @s run \
        function overly_realistic:general/spears/spear_hit_entity
