execute as @e[type=item,nbt={Item:{id:"minecraft:carrot"}},predicate=survivalplus:cooking_pot] store result score @s itemcount run data get entity @s Item.count
execute as @e[type=item,nbt={Item:{id:"minecraft:potato"}},predicate=survivalplus:cooking_pot] store result score @s itemcount run data get entity @s Item.count
execute as @e[type=item,nbt={Item:{id:"minecraft:bowl"}},predicate=survivalplus:cooking_pot] store result score @s itemcount run data get entity @s Item.count

execute as @e[type=item,nbt={Item:{id:"minecraft:carrot"}},predicate=survivalplus:cooking_pot] at @s if score @s itemcount = @n[type=item,nbt={Item:{id:"minecraft:potato"}},predicate=survivalplus:cooking_pot,distance=...5] itemcount run tag @s add evenroot
execute as @e[type=item,nbt={Item:{id:"minecraft:carrot",components:{"minecraft:custom_data":{wild:tag}}}},predicate=survivalplus:cooking_pot] at @s if score @s itemcount = @n[type=item,nbt={Item:{id:"minecraft:potato",components:{"minecraft:custom_data":{wild:tag}}}},predicate=survivalplus:cooking_pot,distance=...5] itemcount run tag @s add wildyep
execute as @e[type=item,nbt={Item:{id:"minecraft:bowl"}},predicate=survivalplus:cooking_pot] at @s if score @s itemcount = @n[type=item,nbt={Item:{id:"minecraft:carrot"}},predicate=survivalplus:cooking_pot,distance=...5] itemcount run tag @s add prepbowl

execute if entity @e[tag=evenroot] if entity @e[tag=wildyep] if entity @e[tag=prepbowl] at @e[tag=evenroot] if entity @e[type=item,nbt={Item:{id:"minecraft:milk_bucket"}},distance=...5,predicate=survivalplus:cooking_pot] run function survivalplus:tools/food/wild_stew
execute if entity @e[tag=evenroot] unless entity @e[tag=wildyep] if entity @e[tag=prepbowl] at @e[tag=evenroot] if entity @e[type=item,nbt={Item:{id:"minecraft:milk_bucket"}},distance=...5,predicate=survivalplus:cooking_pot] run function survivalplus:tools/food/veg_stew

tag @e remove evenroot
tag @e remove prepbowl
tag @e remove wildyep