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

# -> Tag player
tag @s add OverlyRealistic.Player.HasInventoryEdited

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

# -> Modify items
execute if items entity @s inventory.0 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.0 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.0 overly_realistic:food/food_spoil
execute if items entity @s inventory.1 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.1 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.1 overly_realistic:food/food_spoil
execute if items entity @s inventory.2 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.2 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.2 overly_realistic:food/food_spoil
execute if items entity @s inventory.3 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.3 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.3 overly_realistic:food/food_spoil
execute if items entity @s inventory.4 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.4 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.4 overly_realistic:food/food_spoil
execute if items entity @s inventory.5 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.5 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.5 overly_realistic:food/food_spoil
execute if items entity @s inventory.6 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.6 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.6 overly_realistic:food/food_spoil
execute if items entity @s inventory.7 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.7 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.7 overly_realistic:food/food_spoil
execute if items entity @s inventory.8 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.8 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.8 overly_realistic:food/food_spoil
execute if items entity @s inventory.9 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.9 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.9 overly_realistic:food/food_spoil
execute if items entity @s inventory.10 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.10 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.10 overly_realistic:food/food_spoil
execute if items entity @s inventory.11 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.11 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.11 overly_realistic:food/food_spoil
execute if items entity @s inventory.12 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.12 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.12 overly_realistic:food/food_spoil
execute if items entity @s inventory.13 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.13 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.13 overly_realistic:food/food_spoil
execute if items entity @s inventory.14 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.14 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.14 overly_realistic:food/food_spoil
execute if items entity @s inventory.15 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.15 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.15 overly_realistic:food/food_spoil
execute if items entity @s inventory.16 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.16 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.16 overly_realistic:food/food_spoil
execute if items entity @s inventory.17 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.17 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.17 overly_realistic:food/food_spoil
execute if items entity @s inventory.18 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.18 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.18 overly_realistic:food/food_spoil
execute if items entity @s inventory.19 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.19 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.19 overly_realistic:food/food_spoil
execute if items entity @s inventory.20 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.20 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.20 overly_realistic:food/food_spoil
execute if items entity @s inventory.21 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.21 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.21 overly_realistic:food/food_spoil
execute if items entity @s inventory.22 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.22 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.22 overly_realistic:food/food_spoil
execute if items entity @s inventory.23 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.23 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.23 overly_realistic:food/food_spoil
execute if items entity @s inventory.24 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.24 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.24 overly_realistic:food/food_spoil
execute if items entity @s inventory.25 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.25 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.25 overly_realistic:food/food_spoil
execute if items entity @s inventory.26 #overly_realistic:consumables/all_physical_foods unless items entity @s inventory.26 *[custom_data~{or_no_edit:1b}] run item modify entity @s inventory.26 overly_realistic:food/food_spoil
