# 0 -> Not generated

execute if score generation state matches 1 run function generate:0_clear/init
execute if score generation state matches 2 run function generate:0_clear/main

execute if score generation state matches 3 run function generate:1_generate/init
execute if score generation state matches 4 run function generate:1_generate/main

execute if score generation state matches 5 run function generate:2_populate/main
execute if score generation state matches 6 as @e[tag=holder,sort=random] at @s run function generate:2_populate/holders/main
execute if score generation state matches 6 unless entity @e[tag=holder,tag=!more_soon,nbt={HandItems:[{id:"minecraft:barrier"}]},limit=1] run scoreboard players add generation state 1

execute if score generation state matches 7 run function generate:3_done/main

# 10 -> Generated
