title @a times 0 40 20
title @a title [{"bold":true,"color":"red","text":"WAVE "},{"bold":true,"color":"red","score":{"name":"world","objective":"WaveCounter"}},""]
bossbar set minecraft:daytime name [{"bold":true,"color":"dark_red","text":"<<< "},{"color":"#FFBF0F","italic":false,"obfuscated":false,"text":" W"},{"color":"#FFD106","italic":false,"obfuscated":false,"text":"A"},{"color":"#FFDE06","italic":false,"obfuscated":false,"text":"V"},{"color":"#FFE016","italic":false,"obfuscated":false,"text":"E "},{"score": {"name": "world", "objective": "WaveCounter"},"color": "#ffe017"},{"text": " >>>","color":"dark_red"}]
playsound entity.wither.spawn master @a 0 5 0 5 0
bossbar set daytime max 2000
scoreboard players set world NextWaveTimer 0
scoreboard players set world FirstWaveOfIntermissionCheck 1
scoreboard players set world WavePickPercentage 5
scoreboard players set world InIntermission 0
tellraw @a {"clickEvent":{"action":"run_command","value":"/scoreboard players set world NextWaveTimer 1900"},"color":"white","text":"[ Skip to the next wave ]"}

execute if score world WaveCounter matches 21 run function kiwi2:waves/wave_3/set_1/w3s1_wave_roll
execute if score world WaveCounter matches 41 run function kiwi2:waves/wave_2/set_2/w2s2_wave_roll
execute if score world WaveCounter matches 61 run function kiwi2:waves/wave_1/set_3/w1s3_wave_roll
execute if score world WaveCounter matches 81 run function kiwi2:waves/wave_3/set_3/w3s3_wave_roll
execute if score world WaveCounter matches 101 run function kiwi2:waves/wave_1/set_4/w1s4_wave_roll