setblock ~ ~-1 ~ kubejs:pool_tiles

playsound minecraft:entity.zombie.attack_iron_door master @a ~ ~ ~ 0.1 1
playsound minecraft:item.armor.equip_netherite master @a ~ ~ ~ 1 0
playsound minecraft:item.axe.scrape master @a ~ ~ ~ 1 0
particle minecraft:campfire_cosy_smoke ~ ~1 ~ 0.3 0.3 0.3 0.01 10 force
particle minecraft:block kubejs:drain ~ ~1 ~ 0.3 0.3 0.3 0.01 10 force

scoreboard players set max RNG_Constant 4
function backrooms:rng

execute if score RNG RNG_Variable matches 1 run fill ~1 ~-1 ~ ~1 ~-3 ~ kubejs:pool_tiles
execute if score RNG RNG_Variable matches 1 run fill ~-1 ~-1 ~ ~-1 ~-3 ~ kubejs:pool_tiles
execute if score RNG RNG_Variable matches 1 run fill ~ ~-1 ~1 ~ ~-3 ~1 kubejs:pool_tiles
execute if score RNG RNG_Variable matches 1 run fill ~ ~-1 ~-1 ~ ~-3 ~-1 kubejs:pool_tiles

execute if score RNG RNG_Variable matches 1 run fill ~ ~-1 ~ ~ ~-2 ~ cave_air
execute if score RNG RNG_Variable matches 1 run setblock ~ ~-3 ~ antiblocksrechiseled:wool_white
execute if score RNG RNG_Variable matches 1 run setblock ~ ~-4 ~ repeating_command_block[facing=up]{auto:1b,Command:"execute positioned ~ ~0.5 ~ as @e[distance=..0.5] run function backrooms:poolrooms_enter"} replace

execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
execute if score RNG RNG_Variable matches 1 run playsound minecraft:ambient.underwater.loop.additions.ultra_rare master @a ~ ~ ~ 1 0
