# 2: Day 2 reminder message (localized with fallback)
execute if score cycle scav_cycle matches 2 run execute as @e[type=armor_stand,nbt={CustomName:'{"text":"ScavengerBase"}'}] at @s run tellraw @a[distance=..12] {"text":"Zombies, man… they creep me out.... Got what you need before I go?","color":"yellow","bold":true}
execute if score cycle scav_cycle matches 2 run execute as @e[type=armor_stand,nbt={CustomName:'{"text":"ScavengerBase"}'}] at @s unless entity @a[distance=..12] run tellraw @a {"text":"Zombies, man… they creep me out.... Got what you need before I go?","color":"yellow","bold":true}

# 3: Despawn + message (localized with fallback)
execute if score cycle scav_cycle matches 3 if score state scav_state matches 1 run execute as @e[type=armor_stand,nbt={CustomName:'{"text":"ScavengerBase"}'}] at @s run tellraw @a[distance=..12] {"text":"I’ll be gone today, don’t get yourself killed and keep the fire burning ‘til I’m back.","color":"red","bold":true}
execute if score cycle scav_cycle matches 3 if score state scav_state matches 1 run execute as @e[type=armor_stand,nbt={CustomName:'{"text":"ScavengerBase"}'}] at @s unless entity @a[distance=..12] run tellraw @a {"text":"I’ll be gone today, don’t get yourself killed and keep the fire burning ‘til I’m back.","color":"red","bold":true}
execute if score cycle scav_cycle matches 3 if score state scav_state matches 1 run function scavenger:despawn

# 4: Restock (message handled by spawn), then reset to 1
execute if score cycle scav_cycle matches 4 run function scavenger:restock_cycle
execute if score cycle scav_cycle matches 4 run scoreboard players set cycle scav_cycle 1
