scoreboard objectives add scav_state dummy
scoreboard objectives add scav_cycle dummy
scoreboard objectives add last_day dummy
scoreboard objectives add cur_day dummy
scoreboard objectives add sel_count dummy

# Init
scoreboard players set state scav_state 0
execute unless score cycle scav_cycle matches 1..4 run scoreboard players set cycle scav_cycle 1
execute store result score cur_day cur_day run time query day
scoreboard players operation last last_day = cur_day cur_day
