function kiwi2:spawning
execute in kiwi2:limitbreak_run_dimension unless entity @e[type=text_display,tag=controller_mob,tag=limitbreak_starting_mob] if entity @a[gamemode=survival] run function kiwi2:run_dimension/wave_start
execute in kiwi2:limitbreak_run_dimension unless entity @e[type=text_display,tag=controller_mob,tag=limitbreak_continue_mob] if entity @a[gamemode=survival] if score world InIntermission matches 1 run function kiwi2:run_dimension/wave_continue
execute if entity @a[scores={RestoreAttributes=1..}] run function kiwi2:points/point_milestones_regive_after_death
execute if entity @a[scores={StatCheck=1..}] as @a[scores={StatCheck=1..}] at @s run function kiwi2:points/stat_checker/player_stats
execute if entity @a[scores={EndRun=1..}] as @a at @s run function kiwi2:manual_end_run_confirm
function kiwi2:reward_chest/day_20_39/custom_items_tick
function kiwi2:reward_chest/day_40_59/custom_items_tick
execute as @a[advancements={kiwi2:point_crystal=true}] run function kiwi2:points/point_crystal_give
execute as @a[advancements={kiwi2:point_clump=true}] run function kiwi2:points/point_clump_give
execute as @a[advancements={kiwi2:point_dust=true}] run function kiwi2:points/point_dust_give
execute as @a[advancements={kiwi2:border_upgrade_1=true}] run function kiwi2:border/border_upgrade_1_give
execute as @a[advancements={kiwi2:border_upgrade_2=true}] run function kiwi2:border/border_upgrade_2_give
execute as @a[advancements={kiwi2:border_upgrade_3=true}] run function kiwi2:border/border_upgrade_3_give_title
execute as @a[advancements={kiwi2:border_upgrade_4=true}] run function kiwi2:border/border_upgrade_4_give

# execute if entity @a[nbt={attributes:[{modifiers:[{id:"minecraft:1000_points_max_health_upgrade"}]}]},tag=!skill_window] as @a[nbt={attributes:[{modifiers:[{id:"minecraft:1000_points_max_health_upgrade"}]}]},tag=!skill_window] at @s run function kiwi2:choose_skill_phase_1
execute if entity @a[tag=limitbreak_dead_player,gamemode=!spectator] as @a[tag=limitbreak_dead_player,gamemode=!spectator] at @s run gamemode spectator @s
execute as @a at @s if dimension minecraft:overworld in kiwi2:limitbreak_run_dimension run tp @s 0 1 0

execute as @e[tag=custom_storage] at @s unless score @s StorageCount = $temp StorageCount run tp @s 0 -128 0
execute as @a at @s if items entity @s weapon.* structure_block[custom_data={storage:1b}] run function kiwi2:custom_storage/custom_chest_gui_open

execute as @a[team=!Player_Glow] if score world OneSecondTimer matches 19.. run team join Player_Glow @s
execute as @a if score world OneSecondTimer matches 20.. run function kiwi2:detect_player_join