execute store result score world Spawning_Rolled run random value 1..5

# Triple check for same waves back to back.
# If it passes all three (1/n^4) probability, the same wave will spawn
execute if score world PreviousWaveRoll = world Spawning_Rolled run execute store result score world Spawning_Rolled run random value 1..5
execute if score world PreviousWaveRoll = world Spawning_Rolled run execute store result score world Spawning_Rolled run random value 1..5
execute if score world PreviousWaveRoll = world Spawning_Rolled run execute store result score world Spawning_Rolled run random value 1..5

execute store result score world PreviousWaveRoll run scoreboard players get world Spawning_Rolled

execute if score world Spawning_Rolled matches 1 run function kiwi2:waves/wave_3/set_1/miniboss_subterranean_silverfish_wave
execute if score world Spawning_Rolled matches 2 run function kiwi2:waves/wave_3/set_1/2_matriarch_spider_wave
execute if score world Spawning_Rolled matches 3 run function kiwi2:waves/wave_3/set_1/2_ravager_wave
execute if score world Spawning_Rolled matches 4 run function kiwi2:waves/wave_3/set_1/4_black_shuck_wave
execute if score world Spawning_Rolled matches 5 run function kiwi2:waves/wave_3/set_1/5_pillager_1_evoker_wave