scoreboard players set @s room_clock 40
execute as @a run function items:passive/room_trigger/wave_end

execute if score @s room_wave matches 2 if entity @e[tag=mob,tag=w2,dx=44,dy=32,dz=44] run scoreboard players set @s room_state 3
execute if score @s room_wave matches 3 if entity @e[tag=mob,tag=w3,dx=44,dy=32,dz=44] run scoreboard players set @s room_state 3

execute unless score @s room_state matches 3 run scoreboard players set @s room_state 5
