
# -> Update gamemode
gamemode survival @s[gamemode=spectator]

# -> Untag player
tag @s remove OverlyRealistic.Player.IsGhost

# -> Spawn protection
execute if score #or.setting.spawn_protection OverlyRealistic.Settings.ArbitrarySetting matches 1 run \
    effect give @s resistance 8 250 true

# -> Apply data holder
item replace entity @s armor.body with poisonous_potato\
    [\
        custom_data=\
            {\
                overly_realistic_data_holder: 1b, \
                last_version_modified: "v3.0.3", \
                last_version_modified_id: 15i, \
                attribute_modifiers_on_death: [] \
            },\
        enchantments=\
            {\
                binding_curse: 1, \
                "overly_realistic:or_internal_dataholder": 1 \
            },\
        equippable=\
            {\
                slot:"body", \
                damage_on_hurt:false, \
                equip_sound:"intentionally_empty", \
                swappable:false \
            }\
    ]

# -> Reset wisdom skills
function overly_realistic:main/debug/wisdom/reset_wisdom

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

# -> If 'disable genetics' is enabled then return
execute if score #or.setting.disable_genetics OverlyRealistic.Settings.ArbitrarySetting matches 1 run \
    return fail

# -> Apply data
function overly_realistic:players/custom_data/apply_general_data

# -> Apply random data
function overly_realistic:players/custom_data/get_random_data

# -> Set stamina to max stamina
scoreboard players operation @s OverlyRealistic.Player.Stats.Stamina = @s OverlyRealistic.Player.Stats.MaxStamina

# -> Apply scale balances
function overly_realistic:players/custom_data/scale_balance
