execute as @a[scores={checkpoint=31,checkpoint_between_31=0}] at @s positioned -24 90 -15 if entity @s[distance=..2] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=31,checkpoint_between_31=0}] at @s positioned -24 90 -15 if entity @s[distance=..2] run spawnpoint @s -24 90 -15 21 0
execute as @a[scores={checkpoint=31,checkpoint_between_31=0}] at @s positioned -24 90 -15 if entity @s[distance=..2] run scoreboard players set @s checkpoint_between_31 1

execute as @a[scores={checkpoint=31,checkpoint_between_31=1}] at @s positioned -21 77 -8 if entity @s[distance=..2] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=31,checkpoint_between_31=1}] at @s positioned -21 77 -8 if entity @s[distance=..2] run spawnpoint @s -21 77 -8 269.25 0
execute as @a[scores={checkpoint=31,checkpoint_between_31=1}] at @s positioned -21 77 -8 if entity @s[distance=..2] run scoreboard players set @s checkpoint_between_31 2



execute as @a[scores={checkpoint=31}] at @s run execute as @s[y=65,dy=0] at @s run function koncept:return_stage with storage stage:checkpoint

execute as @a[scores={checkpoint=31}] at @s positioned -4 74 -16 if entity @s[distance=..1] run schedule function koncept:teleport5 5t append
execute as @a[scores={checkpoint=31}] at @s positioned -4 74 -16 if entity @s[distance=..1] run tp @s -22.70 84.20 -4.30 -135.24 14.98


execute if block -17 76 -32 minecraft:oak_button[face=wall,facing=west,powered=true] run fill -25 78 -38 -26 78 -39 minecraft:stone_bricks

execute if block -17 76 -32 minecraft:oak_button[face=wall,facing=west,powered=false] run fill -25 78 -38 -26 78 -39 minecraft:air



#43 44 45 46

execute positioned -32 84 -23 if entity @a[distance=..2] run scoreboard players set 43 timer_an 1
execute if score 43 timer_an matches 1 run scoreboard players add 44 timer_an 1

execute if score 44 timer_an matches 1..80 run execute as @e[tag=block_motion1] at @s run tp @s ~ ~-0.1 ~-0.1
execute if score 44 timer_an matches 81..140 run execute as @e[tag=block_motion1] at @s run tp @s ~ ~ ~-0.1
execute if score 44 timer_an matches 141..230 run execute as @e[tag=block_motion1] at @s run tp @s ~0.1 ~ ~

execute if score 44 timer_an matches 280..324 run execute as @e[tag=block_motion1] at @s run tp @s ~-0.2 ~ ~
execute if score 44 timer_an matches 325..354 run execute as @e[tag=block_motion1] at @s run tp @s ~ ~ ~0.2
execute if score 44 timer_an matches 344..383 run execute as @e[tag=block_motion1] at @s run tp @s ~ ~0.2 ~0.2

execute if score 44 timer_an matches 384.. run scoreboard players reset 43 timer_an
execute if score 44 timer_an matches 384.. run scoreboard players reset 44 timer_an



#38 39 40 41

execute if block -24 86 -24 minecraft:lever[face=wall,facing=south,powered=true] run scoreboard players set 38 timer_an 1
execute if score 38 timer_an matches 1 run scoreboard players add 39 timer_an 1

execute positioned -24 86 -23 run tag @a[distance=..2] add block_motion_shulker1

execute if score 39 timer_an matches 1 run tag @e[type=minecraft:shulker,tag=block_motion_shulker] add block_motion_shulker1
execute if score 39 timer_an matches 1.. run setblock -24 86 -24 minecraft:lever[face=wall,facing=south,powered=true]
execute if score 39 timer_an matches 1..100 run execute as @e[type=minecraft:block_display,tag=block_motion] at @s run tp @s ~ ~0.05 ~0.05
execute if score 39 timer_an matches 130..229 run execute as @e[type=minecraft:block_display,tag=block_motion] at @s run tp @s ~ ~-0.05 ~-0.05
execute if score 39 timer_an matches 130 run tag @e[type=minecraft:shulker,tag=block_motion_shulker] remove block_motion_shulker1

execute if score 39 timer_an matches 240 run setblock -24 86 -24 minecraft:lever[face=wall,facing=south,powered=false]
execute if score 39 timer_an matches 240 run scoreboard players reset 38 timer_an
execute if score 39 timer_an matches 240 run scoreboard players reset 39 timer_an

#execute if score 39 timer_an matches 1..100 run effect give @a[tag=block_motion_shulker1] minecraft:slowness 1 1 true
execute if score 39 timer_an matches 1..100 run execute as @a[tag=block_motion_shulker1] at @s run tp @s ~ ~0.05 ~0.05
#execute if score 39 timer_an matches 1..100 run effect give @a[tag=block_motion_shulker1] minecraft:jump_boost 3 137 true

execute if score 39 timer_an matches 101 run effect clear @a[tag=block_motion_shulker1] minecraft:slowness
execute if score 39 timer_an matches 105 run tag @a[tag=block_motion_shulker1] remove block_motion_shulker1
execute if score 39 timer_an matches 101 run effect clear @a[tag=block_motion_shulker1] minecraft:levitation
