
# --> Spoil [donkey]

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

# -> Do spoilage
execute as @e[type=donkey,tag=!OverlyRealistic.Donkey.HasInventoryEdited,limit=4,sort=arbitrary,x=0] run \
    function overly_realistic:general/food/food_spoilage/spoil_from_loop/spoil_35_b

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

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