
# -> If attacker is not tagged player then return
scoreboard players set #or.entity_has_been_attacked_by_player OverlyRealistic.General.ArbitraryData 0
execute on attacker \
    if entity @s[type=player,tag=OverlyRealistic.Player.PlayerAttackedEntity] run \
        scoreboard players set #or.entity_has_been_attacked_by_player OverlyRealistic.General.ArbitraryData 1
execute if score #or.entity_has_been_attacked_by_player OverlyRealistic.General.ArbitraryData matches 0 run \
    return fail

# -> If entity is on ground then create blood splatter
execute if score #or.setting.generate_blood_splatters OverlyRealistic.Settings.ArbitrarySetting matches 1 \
    unless block ~ ~-1 ~ #overly_realistic:spear_can_passthrough \
    unless block ~ ~-0.1 ~ #overly_realistic:ground_markings_cant_generate_on \
    if predicate overly_realistic:global/is_on_ground run \
        function overly_realistic:players/misc/ground_markings/blood/create_blood_splatter
        