
# --> Spoil [barrel]

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

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

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

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