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

function main:setarena
function main:clearschedule
kill @e[type=minecraft:armor_stand,tag=holo]
tag @a remove processed
scoreboard objectives remove queue
scoreboard objectives add queue
scoreboard players set $order queue 0
scoreboard players set $constant queue 0
scoreboard players set $constant PlayerCount 0
scoreboard objectives remove points
scoreboard players set $round round 0
scoreboard players set @a played 0
scoreboard objectives add points dummy
scoreboard players set $difficulty ip 2
execute store result score max id if entity @a[tag=ready]
execute if score order id = max id run scoreboard players set order id 0
setblock 8 4 2 minecraft:structure_block
data modify block 8 4 2 mode set value "LOAD"
data modify block 8 4 2 name set value "minecraft:clear"
data modify block 8 4 2 posX set value -5
data modify block 8 4 2 posY set value 2
data modify block 8 4 2 posZ set value -3
fill 3 6 17 13 11 11 air
setblock 8 3 2 minecraft:redstone_block
setblock 8 16 14 minecraft:structure_block
data modify block 8 16 14 mode set value "LOAD"
data modify block 8 16 14 name set value "minecraft:build1"
data modify block 8 16 14 posX set value -5
data modify block 8 16 14 posY set value 2
data modify block 8 16 14 posZ set value -3
data modify block 8 16 14 mirror set value "LEFT_RIGHT"
setblock 8 17 14 minecraft:redstone_block
schedule function main:redstone 1s
clear @a
tag @a remove DoubleJumper
tag @a remove DoubleJump
scoreboard players reset @a wins
scoreboard objectives remove wins
scoreboard objectives add wins dummy {"text":"Points!","color":"gold"}
scoreboard objectives setdisplay sidebar
scoreboard players set $round round 0
scoreboard objectives add jump_timer dummy
scoreboard players set @a jump_timer 0
bossbar set minecraft:time value 10
tag @a remove ingame
tag @a remove inround
tag @a remove win
tag @a remove sep
scoreboard objectives remove jtimer
scoreboard objectives remove jump
scoreboard objectives remove sneak
scoreboard objectives remove id
scoreboard objectives add jump minecraft.custom:minecraft.jump
scoreboard objectives add sneak minecraft.custom:minecraft.sneak_time
scoreboard objectives add jtimer dummy
scoreboard objectives add id dummy
scoreboard players set $difficulty ip 2
scoreboard players set $progress ip 0
scoreboard players set $confirm ip 0
scoreboard players set random build 0
schedule function main:reset2 2s
scoreboard players set $max points 5
scoreboard objectives remove id
scoreboard objectives add id dummy
scoreboard players set #ready ready 0
tag @a remove ready
bossbar set minecraft:time style progress
bossbar set minecraft:time max 20
bossbar set minecraft:time value 20
bossbar set time name [{"text":" "}]
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":""}']}}