
# -> Reset HasDiedPostDowning
scoreboard players reset @s OverlyRealistic.Player.HasDiedPostDowning

# -> Remove physical traumas
function overly_realistic:main/debug/stats/remove_physical_trauma

# -> Reset onDeath
function overly_realistic:main/debug/stats/reset_ondeath_stats

# -> Create corpse
execute if score #or.setting.player_corpses OverlyRealistic.Settings.ArbitrarySetting matches 1 run \
    function overly_realistic:general/downing/player_corpse/create_corpse/player_create_corpse

# -> Decrease nearby players' mental health
scoreboard players set #or.central_value_set_mental_health OverlyRealistic.General.ArbitraryData 35
execute as @a[distance=..16] run \
    function overly_realistic:players/mental_health/decrease_mental_health

# -> Decrease attacker's mental health
scoreboard players set #or.central_value_set_mental_health OverlyRealistic.General.ArbitraryData 5
execute on attacker run \
    function overly_realistic:players/mental_health/decrease_mental_health

# -> Remove possible tag
tag @s remove OverlyRealistic.Player.LeftWhileDowned

# -> Set as ghost
function overly_realistic:players/custom_data/spawn_as_ghost
