
# -> Message
tellraw @s [{translate:"initialization.overlyrealistic.join_message_v3_4_0",fallback:"\n%2$s Successfully connected!\n\n%1$s You are not using the required resource pack! Please install it by %3$s \n",with:[{text:"x",color:"#b83030"},{text:"✔",color:"#29c94b"},{text:"[Clicking here]",bold:true,color:"gold",hover_event:{action:"show_text",value:{text:">Click here to open the resource pack download page!",color:"gold"}},click_event:{action:"open_url",url:"https://modrinth.com/resourcepack/overly-realistic-base-resources/versions"}}]}]

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

# -> If player is supposed to be moved to the surface then schedule function
execute if entity @s[tag=OverlyRealistic.Player.PlayerMustMoveToSurface] run \
    schedule function overly_realistic:players/revive/randomized_respawning/set_position_surface_0 3t

# -> If player was not downed when they left then return
execute unless entity @s[tag=OverlyRealistic.Player.IsDowned] run \
    return fail

# -> Tag player
tag @s add OverlyRealistic.Player.LeftWhileDowned

# -> Kill player
function overly_realistic:general/downing/downing_end_killed

# -> Schedule delay for paper patch
schedule function overly_realistic:general/downing/delayed_downing_loop 1s
