
execute as @a[scores={checkpoint=17,checkpoint_between_17=0}] at @s positioned -2 76 37 if entity @s[distance=..2] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=17,checkpoint_between_17=0}] at @s positioned -2 76 37 if entity @s[distance=..2] run spawnpoint @s -2 76 37 -1.16 0
execute as @a[scores={checkpoint=17,checkpoint_between_17=0}] at @s positioned -2 76 37 if entity @s[distance=..2] run scoreboard players set @s checkpoint_between_17 1

execute as @a[scores={checkpoint=17,checkpoint_between_17=1}] at @s positioned -14 76 44 if entity @s[distance=..2] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=17,checkpoint_between_17=1}] at @s positioned -14 76 44 if entity @s[distance=..2] run spawnpoint @s -15 76 44 -10.33 0
execute as @a[scores={checkpoint=17,checkpoint_between_17=1}] at @s positioned -14 76 44 if entity @s[distance=..2] run scoreboard players set @s checkpoint_between_17 2

execute as @a[scores={checkpoint=17,checkpoint_between_17=2}] at @s positioned -3 65 53 if entity @s[distance=..2] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=17,checkpoint_between_17=2}] at @s positioned -3 65 53 if entity @s[distance=..2] run spawnpoint @s -3 65 53 -163.67 0
execute as @a[scores={checkpoint=17,checkpoint_between_17=2}] at @s positioned -3 65 53 if entity @s[distance=..2] run scoreboard players set @s checkpoint_between_17 3


execute as @a[scores={checkpoint=17}] at @s run execute positioned 7 58 62 if entity @s[distance=..1] run tag @s add 19capitan
execute as @a[scores={checkpoint=17}] at @s run execute positioned 7 58 64 if entity @s[distance=..1] run tag @s remove 19capitan



execute as @a[scores={checkpoint=17}] at @s run execute positioned 6.66 64.33 63.00 if entity @s[scores={checkpoint=17},distance=..5] run tag @s add woter_22no
title @a[scores={checkpoint=17},tag=woter_22no] reset

tag @a[scores={checkpoint=17}] add woter

title @a[scores={checkpoint=17},tag=!woteryes] title {"text":"1"}
title @a[scores={checkpoint=17},tag=!woteryes] subtitle {"text":""}
title @a[scores={checkpoint=17},tag=!woteryes] title {"text":""}
title @a[scores={checkpoint=17},tag=!woteryes] times 1 1 1000s

tag @a[scores={checkpoint=17},tag=woter] add woteryes

execute positioned 0 64 58 if entity @a[scores={checkpoint=17},distance=..2] unless score 101 timer matches 2 run scoreboard players set 101 timer 1
execute if score 101 timer matches 1 run scoreboard players add 100 timer 1

execute if score 100 timer matches 2 run setblock 1 64 56 minecraft:sea_pickle[pickles=4,waterlogged=false]
execute if score 100 timer matches 2 run execute positioned 1 64 56 run playsound minecraft:entity.item.pickup block @a[distance=..8] 1 64 56 1111 1

execute if score 100 timer matches 20 run setblock 1 64 54 minecraft:sea_pickle[pickles=4,waterlogged=false]
execute if score 100 timer matches 20 run execute positioned 1 64 56 run playsound minecraft:entity.item.pickup block @a[distance=..8] 1 64 56 1111 1

execute if score 100 timer matches 40 run setblock 2 65 52 minecraft:sea_pickle[pickles=4,waterlogged=false]
execute if score 100 timer matches 40 run execute positioned 1 64 56 run playsound minecraft:entity.item.pickup block @a[distance=..8] 1 64 56 1111 1

execute as @a at @s positioned 0.66 64.00 59.25 if entity @s[distance=..2.5] run tag @s add 17_set_bl
execute as @a at @s positioned 6.56 64.00 58.47 if entity @s[distance=..3] run tag @s remove 17_set_bl

execute if score 100 timer matches 50 run scoreboard players set 101 timer 2
execute if score 101 timer matches 2 run execute positioned -1 64 54 unless entity @a[distance=..5,tag=17_set_bl] run scoreboard players set 101 timer 3
execute if score 101 timer matches 3 run scoreboard players add 100 timer 1
execute if score 100 timer matches 80 run setblock 1 64 56 minecraft:air
execute if score 100 timer matches 90 run setblock 1 64 54 minecraft:air
execute if score 100 timer matches 100 run setblock 2 65 52 minecraft:air
execute if score 100 timer matches 100 run scoreboard players reset 101 timer
execute if score 100 timer matches 100 run scoreboard players reset 100 timer

particle minecraft:underwater -5 70 45 1 1 1 11 1
particle minecraft:underwater -11 78 41 -3 1 3 11 10
particle minecraft:underwater 0 65 53 -3 3 3 11 10

execute as @a[scores={checkpoint=17}] at @s if block ~ ~-0.3 ~ minecraft:sand run function koncept:return_stage
execute as @a[scores={checkpoint=17}] at @s if block ~ ~ ~ #minecraft:wot run function koncept:return_stage