#built using mc-build (https://mcbuild.dev/)

execute if score $players PlayerCount matches ..1 run scoreboard players set $map mapselect 1
execute if score $map mapselect matches 3.. run scoreboard players set $map mapselect 1
execute if score $map mapselect matches ..0 run scoreboard players set $map mapselect 2
execute if score $map mapselect matches 1 run data merge block -6 34 0 {front_text:{messages:['{"text":""}','{"text":"Mirror","color":"yellow"}','{"text":"[One by One]","color":"white"}','{"text":""}']}}
execute if score $map mapselect matches 2 run data merge block -6 34 0 {front_text:{messages:['{"text":""}','{"text":"Versus","color":"yellow"}','{"text":"[One vs One]","color":"white"}','{"text":""}']}}
execute if blocks 3 5 17 13 11 11 3 17 5 all run function main:complete
execute if blocks -5 5 17 5 11 11 3 17 5 all as @a[tag=sep,scores={id=2}] run function main:leftcomplete
execute if blocks 11 5 17 21 11 11 3 17 5 all as @a[tag=sep,scores={id=3}] run function main:rightcomplete
effect give @a saturation 100000 255 true
effect give @a regeneration 100000 255 true
effect give @a night_vision 100000 255 true
effect give @a haste 100000 120 true
bossbar set minecraft:time players @a[team=!lobby]
advancement revoke @a everything
gamerule doLimitedCrafting true
recipe take @a *
execute as @e[type=item] at @s run function loot:__generated__/execute/1
execute as @e[type=item] at @s run data modify entity @s Item.tag.HideFlags set value 127
execute store result score $players PlayerCount if entity @a
execute if score $players PlayerCount matches 1.. if score $progress ip matches 0 if score $confirm ip matches 0 run team join lobby @a
execute if score $map mapselect matches 1 if score $round round matches 150 run scoreboard players set $round round 1
gamemode adventure @a[tag=!aandeel]
execute as @a[team=ingame] if score @s wins = $max points at @s run function main:temp/sub/text/_hidden_/win
data merge block -4 34 -8 {front_text:{messages:['{"text":""}','{"text":"Points To Win","color":"#FEFFB6","bold":true}','{"score":{"name":"$max","objective":"points"},"color":"#ACF8F5","bold":true}','{"text":""}']}}
execute if score $max points matches 31.. run scoreboard players set $max points 30
execute if score $max points matches ..1 run scoreboard players set $max points 1
scoreboard players add @a[tag=DoubleJump] jump_timer 1
tag @a[tag=DoubleJumper,nbt={FallFlying:1b,}] add DoubleJump
clear @a[tag=DoubleJump] minecraft:elytra
tag @a[scores={jump_timer=4}] remove DoubleJump
effect give @a[scores={jump_timer=1}] minecraft:levitation 1 30 true
effect clear @a[scores={jump_timer=4}] minecraft:levitation
scoreboard players set @a[scores={jump_timer=4}] jump_timer 0
execute as @a[tag=DoubleJumper,nbt={OnGround:1b}] run item replace entity @a[tag=DoubleJumper,nbt={OnGround:1b}] armor.chest with minecraft:elytra{Enchantments:[{id:"minecraft:binding_curse",lvl:1s}],Unbreakable:1b}
execute at @a[tag=DoubleJumper,nbt={FallFlying:1b}] anchored feet run particle minecraft:poof ~ ~ ~ 0.4 0.4 0.4 0 30
execute at @a[tag=DoubleJumper,nbt={FallFlying:1b}] run playsound minecraft:block.slime_block.fall ambient @a ~ ~ ~
execute if score $progress ip matches 0 run title @a[team=lobby] actionbar ["",{"score":{"name":"$people","objective":"ready"},"bold":true,"color":"gold"},{"text":"/","bold":true,"color":"red"},{"score":{"name":"$players","objective":"PlayerCount"},"bold":true,"color":"gold"},{"text":" Players are Ready to Play","bold":true,"color":"red"}]
kill @e[type=item,nbt={Item:{id:"minecraft:carrot_on_a_stick"}}]
execute store result score $people ready if entity @a[team=lobby,tag=ready]
execute as @a if score @s[team=lobby,tag=!ready] readyup matches 1 run function main:__generated__/execute/19
execute as @a if score @s[team=lobby,tag=ready] readyup matches 1 run function main:__generated__/execute/20
execute if entity @a[team=lobby,tag=!ready,tag=!admin] run function main:__generated__/execute/21
execute if entity @a[team=lobby,tag=ready,tag=!admin] run function main:__generated__/execute/22
execute if score $difficulty ip matches 1 run data merge block 4 34 -8 {front_text:{messages:['{"text":""}','{"text":"Difficulty","color":"#FEFFB6","bold":true}','{"text":"Professional","color":"white","bold":true}','{"text":"(15s)","color":"white"}']}}
execute if score $difficulty ip matches 2 run data merge block 4 34 -8 {front_text:{messages:['{"text":"[Recommended]","color":"yellow"}','{"text":"Difficulty","color":"#FEFFB6","bold":true}','{"text":"Intermediate","color":"white","bold":true}','{"text":"(20s)","color":"white"}']}}
execute if score $difficulty ip matches 3 run data merge block 4 34 -8 {front_text:{messages:['{"text":""}','{"text":"Difficulty","color":"#FEFFB6","bold":true}','{"text":"Amateur","color":"white","bold":true}','{"text":"(30s)","color":"white"}']}}
execute if score $difficulty ip matches 4.. run scoreboard players set $difficulty ip 1
execute if score $difficulty ip matches ..0 run scoreboard players set $difficulty ip 3