
# --> Spoil [chest]

# -> Reset success
scoreboard players set #or.chest_count_success OverlyRealistic.General.ArbitraryData 0

# -> Do spoilage
execute as @n[type=marker,tag=!OverlyRealistic.Chest.HasInventoryEdited,tag=OverlyRealistic.Block.ContainerIsChest,sort=arbitrary] \
    at @s run \
        function overly_realistic:general/food/food_spoilage/spoil_from_loop/spoil_23_b

# -> If success = 1 then return and loop
execute if score #or.chest_count_success OverlyRealistic.General.ArbitraryData matches 1 run \
    return run \
        schedule function overly_realistic:general/food/food_spoilage/spoil_from_loop/spoil_23_a 1t

# -> Schedule next spoilage
schedule function overly_realistic:general/food/food_spoilage/spoil_from_loop/spoil_24_a 1t
