
# -> Get X pos
execute store result storage overly_realistic:randomized_respawning respawn_pos_x double 1 run \
    random value -29999980..29999980

# -> Get Z pos
execute store result storage overly_realistic:randomized_respawning respawn_pos_z double 1 run \
    random value -29999980..29999980

# -> Debug
#data modify storage overly_realistic:randomized_respawning respawn_pos_x set value 19
#data modify storage overly_realistic:randomized_respawning respawn_pos_z set value 76

# -> Move player
function overly_realistic:players/revive/randomized_respawning/move_player with storage overly_realistic:randomized_respawning

# -> Set effects
effect give @s slow_falling 1 0 true

# -> Tag player for surface move
tag @s add OverlyRealistic.Player.PlayerMustMoveToSurface

# -> Move player to surface with delay
schedule function overly_realistic:players/revive/randomized_respawning/set_position_surface_0 10t append


# function overly_realistic:players/revive/randomized_respawning/respawn_player
