
# -> Set success
scoreboard players set #or.donkey_count_success OverlyRealistic.General.ArbitraryData 1

# -> Tag donkey
tag @s add OverlyRealistic.Donkey.HasInventoryEdited

# -> If donkey does not have food in inventory then return
execute unless items entity @s horse.* #overly_realistic:consumables/all_physical_foods run \
    return fail

# -> Do spoilage
execute if items entity @s horse.0 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.0 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.0 overly_realistic:food/food_spoil
execute if items entity @s horse.1 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.1 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.1 overly_realistic:food/food_spoil
execute if items entity @s horse.2 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.2 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.2 overly_realistic:food/food_spoil
execute if items entity @s horse.3 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.3 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.3 overly_realistic:food/food_spoil
execute if items entity @s horse.4 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.4 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.4 overly_realistic:food/food_spoil
execute if items entity @s horse.5 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.5 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.5 overly_realistic:food/food_spoil
execute if items entity @s horse.6 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.6 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.6 overly_realistic:food/food_spoil
execute if items entity @s horse.7 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.7 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.7 overly_realistic:food/food_spoil
execute if items entity @s horse.8 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.8 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.8 overly_realistic:food/food_spoil
execute if items entity @s horse.9 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.9 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.9 overly_realistic:food/food_spoil
execute if items entity @s horse.10 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.10 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.10 overly_realistic:food/food_spoil
execute if items entity @s horse.11 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.11 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.11 overly_realistic:food/food_spoil
execute if items entity @s horse.12 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.12 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.12 overly_realistic:food/food_spoil
execute if items entity @s horse.13 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.13 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.13 overly_realistic:food/food_spoil
execute if items entity @s horse.14 #overly_realistic:consumables/all_physical_foods unless items entity @s horse.14 *[custom_data~{or_no_edit:1b}] run item modify entity @s horse.14 overly_realistic:food/food_spoil
