I am trying to make a food data pack, in 1.16.3, i have ever thing working but the health or food buff that should trigger when you eat the food. right now i am going for a health regain after you eat one. Any help on triggering the effect part would be super useful? The effect wont trigger when eating the food in game.
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_beef",tag:{beef:3b}}}] beef_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_chicken",tag:{chicken:3b}}}] chicken_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_cod",tag:{cod:3b}}}] cod_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_mutton",tag:{mutton:3b}}}] mutton_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{porkchop:3b}}}] porkchop_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_salmon",tag:{salmon:3b}}}] salmon_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_rabbit",tag:{rabbit:3b}}}] rabbit_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{berrypie:3b}}}] berrypie_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{honeyham:3b}}}] honeyham_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:beetroot",tag:{picklebeet:3b}}}] beetpickle_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:baked_potato",tag:{latkes:3b}}}] latkes_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:bread",tag:{honeybread:3b}}}] honeybread_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{honeybread:3b}}}] pie_delay 2
execute as @a[scores={beef_delay=1..,beef_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={chicken_delay=1..,chicken_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={cod_delay=1..,cod_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={mutton_delay=1..,mutton_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={porkchop_delay=1..,porkchop_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={salmon_delay=1..,salmon_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={rabbit_delay=1..,rabbit_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={honeyham_delay=1..,honeyham_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={picklebeet_delay=1..,picklebeet_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={latkes_delay=1..,latkes_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={honeybread_delay=1..,honeybread_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={pie_delay=1..,pie_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={beef_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_beef",tag:{beef:3b}}}] run scoreboard players remove @s beef_delay 1
execute as @a[scores={chicken_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_chicken",tag:{chicken:3b}}}] run scoreboard players remove @s chicken_delay 1
execute as @a[scores={cod_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_cod",tag:{cod:3b}}}] run scoreboard players remove @s cod_delay 1
execute as @a[scores={mutton_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_mutton",tag:{mutton:3b}}}] run scoreboard players remove @s mutton_delay 1
execute as @a[scores={porkchop_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{porkchop:3b}}}] run scoreboard players remove @s porkchop_delay 1
execute as @a[scores={salmon_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_salmon",tag:{salmon:3b}}}] run scoreboard players remove @s salmon_delay 1
execute as @a[scores={rabbit_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_rabbit",tag:{rabbit:3b}}}] run scoreboard players remove @s rabbit_delay 1
execute as @a[scores={berrypie_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{berrypie:3b}}}] run scoreboard players remove @s berrypie_delay 1
execute as @a[scores={honeyham_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{honeyham:3b}}}] run scoreboard players remove @s honeyham_delay 1
execute as @a[scores={picklebeet_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:beetroot",tag:{picklebeet:3b}}}] run scoreboard players remove @s picklebeet_delay 1
execute as @a[scores={latkes_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:baked_potato",tag:{latkes:3b}}}] run scoreboard players remove @s latkes_delay 1
execute as @a[scores={honeybread_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:bread",tag:{honeybread:3b}}}] run scoreboard players remove @s honeybread_delay 1
execute as @a[scores={pie_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{pie:3b}}}] run scoreboard players remove @s pie_delay 1
##Recipes##
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_beef",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_beef",Count:1b,tag:{display:{Name:'{"text":"Beef Sandwich","italic":false}'},beef:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_chicken",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_chicken",Count:1b,tag:{display:{Name:'{"text":"Chicken Sandwich","italic":false}'},chicken:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_cod",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_cod",Count:1b,tag:{display:{Name:'{"text":"Fish Role","italic":false}'},cod:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_mutton",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_mutton",Count:1b,tag:{display:{Name:'{"text":"Mutton Sandwich","italic":false}'},mutton:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_porkchop",Count:1b,tag:{display:{Name:'{"text":"Pork Sandwich","italic":false}'},porkchop:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_salmon",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_salmon",Count:1b,tag:{display:{Name:'{"text":"Fish Role","italic":false}'},salmon:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_rabbit",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_rabbit",Count:1b,tag:{display:{Name:'{"text":"Rabbit Sandwich","italic":false}'},rabbit:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sweet_berries",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Berry Pie","italic":false}'},pie:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:apple",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Apple Pie","italic":false}'},pie:3b,CustomModelData:2}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Red Velvet Cake","italic":false}'},pie:3b,CustomModelData:3}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:carrot",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Carrot Cake","italic":false}'},pie:3b,CustomModelData:4}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:melon_slice",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Melon Pie","italic":false}'},pie:3b,CustomModelData:5}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus","bottle"],Item:{id:"minecraft:cooked_porkchop",Count:1b,tag:{display:{Name:'{"text":"Glazed Porkchop","italic":false}'},honeyham:3b,CustomModelData:2}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus","bottle"],Item:{id:"minecraft:bread",Count:1b,tag:{display:{Name:'{"text":"Glazed Bread","italic":false}'},honeybread:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:nether_wart",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:beetroot",Count:1b,tag:{display:{Name:'{"text":"Pickled Beet","italic":false}'},picklebeet:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:baked_potato",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:baked_potato",Count:1b,tag:{display:{Name:'{"text":"Red Latkes","italic":false}'},latkes:3b,CustomModelData:1}}}
##each ingredient needs this command once##
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:apple",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:carrot",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:beetroot",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:baked_potato",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:nether_wart",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_beef",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_chicken",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_cod",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_mutton",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_salmon",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_rabbit",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:sweet_berries",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:egg",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:melon_slice",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run playsound minecraft:entity.player.levelup ambient @a
execute as @e[tag=newitem] at @s run particle minecraft:effect ~ ~ ~ .2 .2 .2 0 20
execute as @e[tag=newitem] run tag @s remove newitem
execute as @e[tag=bottle] at @s run summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:glass_bottle",Count:1b}}
execute as @e[tag=bottle] run tag @s remove bottle
Did you run in 1.16.3? I think I forgot to put that.
Yes, I presumed that you were using 1.16.3, so that is what I used. How exactly is your code failing? Is it only the effect part that is not working, or are the functions not working at all?
Yes, I presumed that you were using 1.16.3, so that is what I used. How exactly is your code failing? Is it only the effect part that is not working, or are the functions not working at all?
every thing but the effect fails, i can make the food, they look right, there named right, they have the right tags, but eating them is normal no effect added.
every thing but the effect fails, i can make the food, they look right, there named right, they have the right tags, but eating them is normal no effect added.
And you are sure it is not something silly like the effect not being noticeable because it only lasts for 1 second? Otherwise I am afraid I have no clue why it is not working.
And you are sure it is not something silly like the effect not being noticeable because it only lasts for 1 second? Otherwise I am afraid I have no clue why it is not working.
I am sure, in my test world, I disabled natural health regen. So any health must come from the food, your code worked, mine still does not. I am trying to simplify the code, to make it so less functions need to be repeated.
I am trying to make a food data pack, in 1.16.3, i have ever thing working but the health or food buff that should trigger when you eat the food. right now i am going for a health regain after you eat one. Any help on triggering the effect part would be super useful? The effect wont trigger when eating the food in game.
this is my load function,
scoreboard objectives add beef_eat minecraft.used:minecraft.cooked_beef
scoreboard objectives add chicken_eat minecraft.used:minecraft.cooked_chicken
scoreboard objectives add cod_eat minecraft.used:minecraft.cooked_cod
scoreboard objectives add mutton_eat minecraft.used:minecraft.cooked_mutton
scoreboard objectives add porkchop_eat minecraft.used:minecraft.cooked_porkchop
scoreboard objectives add salmon_eat minecraft.used:minecraft.cooked_salmon
scoreboard objectives add rabbit_eat minecraft.used:minecraft.cooked_rabbit
scoreboard objectives add honeyham_eat minecraft.used:minecraft.cooked_porkchop
scoreboard objectives add beatroot_eat minecraft.used:minecraft.beetroot
scoreboard objectives add latkes_eat minecraft.used:minecraft.baked_potato
scoreboard objectives add honeybread_eat minecraft.used:minecraft.bread
scoreboard objectives add pie_eat minecraft.used:minecraft.pumpkin_pie
scoreboard objectives add beef_delay dummy
scoreboard objectives add chicken_delay dummy
scoreboard objectives add cod_delay dummy
scoreboard objectives add mutton_delay dummy
scoreboard objectives add porkchop_delay dummy
scoreboard objectives add salmon_delay dummy
scoreboard objectives add rabbit_delay dummy
scoreboard objectives add honeyham_delay dummy
scoreboard objectives add picklbeet_delay dummy
scoreboard objectives add latkes_delay dummy
scoreboard objectives add honeybread_delay dummy
scoreboard objectives add pie_delay dummy
##give @a cooked_beef{beef:3b,CustomModelData:1,display:{Name:'{"text":"Beef Sandwich","italic":false}'}}
##give @a cooked_chicken{chicken:3b,CustomModelData:1,display:{Name:'{"text":"Chicken Sandwich","italic":false}'}}
##give @a cooked_cod{cod:3b,CustomModelData:1,display:{Name:'{"text":"Fish Role","italic":false}'}}
##give @a cooked_mutton{mutton:3b,CustomModelData:1,display:{Name:'{"text":"Mutton Sandwich","italic":false}'}}
##give @a cooked_porkchop{porkchop:3b,CustomModelData:1,display:{Name:'{"text":"Pork Sandwich","italic":false}'}}
##give @a cooked_salmon{salmon:3b,CustomModelData:1,display:{Name:'{"text":"Fish Role","italic":false}'}}
##give @a cooked_rabbit{rabbit:3b,CustomModelData:1,display:{Name:'{"text":"Rabbit Sandwich","italic":false}'}}
##give @a pumpkin_pie{berrypie:3b,CustomModelData:1,display:{Name:'{"text":"Berry Pie","italic":false}'}}
##give @a pumpkin_pie{melonpie:3b,CustomModelData:5,display:{Name:'{"text":"Melon Pie","italic":false}'}}
##give @a pumpkin_pie{applepie:3b,CustomModelData:2,display:{Name:'{"text":"Apple Pie","italic":false}'}}
##give @a pumpkin_pie{beetcake:3b,CustomModelData:3,display:{Name:'{"text":"Red Velvet Cake","italic":false}'}}
##give @a pumpkin_pie{carrotcake:3b,CustomModelData:4,display:{Name:'{"text":"Carrot Cake","italic":false}'}}
##give @a cooked_porkchop{honeypork:3b,CustomModelData:2,display:{Name:'{"text":"Glazed Porkchop","italic":false}'}}
##give @a beetroot{picklebeet:3b,CustomModelData:1,display:{Name:'{"text":"Pickled Beetroot","italic":false}'}}
##give @a baked_potato{letkes:3b,CustomModelData:1,display:{Name:'{"text":"Red Latkes","italic":false}'}}
##give @a bread{honeybread:3b,CustomModelData:1,display:{Name:'{"text":"Glazed Bread","italic":false}'}}
this is my loop fuction,
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_beef",tag:{beef:3b}}}] beef_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_chicken",tag:{chicken:3b}}}] chicken_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_cod",tag:{cod:3b}}}] cod_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_mutton",tag:{mutton:3b}}}] mutton_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{porkchop:3b}}}] porkchop_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_salmon",tag:{salmon:3b}}}] salmon_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_rabbit",tag:{rabbit:3b}}}] rabbit_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{berrypie:3b}}}] berrypie_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{honeyham:3b}}}] honeyham_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:beetroot",tag:{picklebeet:3b}}}] beetpickle_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:baked_potato",tag:{latkes:3b}}}] latkes_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:bread",tag:{honeybread:3b}}}] honeybread_delay 2
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{honeybread:3b}}}] pie_delay 2
execute as @a[scores={beef_delay=1..,beef_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={chicken_delay=1..,chicken_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={cod_delay=1..,cod_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={mutton_delay=1..,mutton_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={porkchop_delay=1..,porkchop_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={salmon_delay=1..,salmon_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={rabbit_delay=1..,rabbit_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={honeyham_delay=1..,honeyham_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={picklebeet_delay=1..,picklebeet_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={latkes_delay=1..,latkes_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={honeybread_delay=1..,honeybread_eat=1}] at @s run effect give @s minecraft:instant_health
execute as @a[scores={pie_delay=1..,pie_eat=1}] at @s run effect give @s minecraft:instant_health
scoreboard players reset @a[scores={beef_eat=1..}] beef_eat
scoreboard players reset @a[scores={chicken_eat=1..}] chicken_eat
scoreboard players reset @a[scores={cod_eat=1..}] cod_eat
scoreboard players reset @a[scores={mutton_eat=1..}] mutton_eat
scoreboard players reset @a[scores={porkchop_eat=1..}] porkchop_eat
scoreboard players reset @a[scores={salmon_eat=1..}] salmon_eat
scoreboard players reset @a[scores={rabbit_eat=1..}] rabbit_eat
scoreboard players reset @a[scores={honeyham_eat=1..}] honeyham_eat
scoreboard players reset @a[scores={picklebeet_eat=1..}] picklebeet_eat
scoreboard players reset @a[scores={latkes_eat=1..}] latkes_eat
scoreboard players reset @a[scores={honeybread_eat=1..}] honeybread_eat
scoreboard players reset @a[scores={pie_eat=1..}] pie_eat
execute as @a[scores={beef_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_beef",tag:{beef:3b}}}] run scoreboard players remove @s beef_delay 1
execute as @a[scores={chicken_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_chicken",tag:{chicken:3b}}}] run scoreboard players remove @s chicken_delay 1
execute as @a[scores={cod_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_cod",tag:{cod:3b}}}] run scoreboard players remove @s cod_delay 1
execute as @a[scores={mutton_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_mutton",tag:{mutton:3b}}}] run scoreboard players remove @s mutton_delay 1
execute as @a[scores={porkchop_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{porkchop:3b}}}] run scoreboard players remove @s porkchop_delay 1
execute as @a[scores={salmon_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_salmon",tag:{salmon:3b}}}] run scoreboard players remove @s salmon_delay 1
execute as @a[scores={rabbit_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_rabbit",tag:{rabbit:3b}}}] run scoreboard players remove @s rabbit_delay 1
execute as @a[scores={berrypie_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{berrypie:3b}}}] run scoreboard players remove @s berrypie_delay 1
execute as @a[scores={honeyham_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:cooked_porkchop",tag:{honeyham:3b}}}] run scoreboard players remove @s honeyham_delay 1
execute as @a[scores={picklebeet_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:beetroot",tag:{picklebeet:3b}}}] run scoreboard players remove @s picklebeet_delay 1
execute as @a[scores={latkes_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:baked_potato",tag:{latkes:3b}}}] run scoreboard players remove @s latkes_delay 1
execute as @a[scores={honeybread_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:bread",tag:{honeybread:3b}}}] run scoreboard players remove @s honeybread_delay 1
execute as @a[scores={pie_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:pumpkin_pie",tag:{pie:3b}}}] run scoreboard players remove @s pie_delay 1
##Recipes##
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_beef",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_beef",Count:1b,tag:{display:{Name:'{"text":"Beef Sandwich","italic":false}'},beef:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_chicken",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_chicken",Count:1b,tag:{display:{Name:'{"text":"Chicken Sandwich","italic":false}'},chicken:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_cod",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_cod",Count:1b,tag:{display:{Name:'{"text":"Fish Role","italic":false}'},cod:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_mutton",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_mutton",Count:1b,tag:{display:{Name:'{"text":"Mutton Sandwich","italic":false}'},mutton:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_porkchop",Count:1b,tag:{display:{Name:'{"text":"Pork Sandwich","italic":false}'},porkchop:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_salmon",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_salmon",Count:1b,tag:{display:{Name:'{"text":"Fish Role","italic":false}'},salmon:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_rabbit",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:cooked_rabbit",Count:1b,tag:{display:{Name:'{"text":"Rabbit Sandwich","italic":false}'},rabbit:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sweet_berries",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Berry Pie","italic":false}'},pie:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:apple",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Apple Pie","italic":false}'},pie:3b,CustomModelData:2}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Red Velvet Cake","italic":false}'},pie:3b,CustomModelData:3}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:carrot",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Carrot Cake","italic":false}'},pie:3b,CustomModelData:4}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:egg",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:melon_slice",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:pumpkin_pie",Count:1b,tag:{display:{Name:'{"text":"Melon Pie","italic":false}'},pie:3b,CustomModelData:5}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus","bottle"],Item:{id:"minecraft:cooked_porkchop",Count:1b,tag:{display:{Name:'{"text":"Glazed Porkchop","italic":false}'},honeyham:3b,CustomModelData:2}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:bread",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus","bottle"],Item:{id:"minecraft:bread",Count:1b,tag:{display:{Name:'{"text":"Glazed Bread","italic":false}'},honeybread:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:nether_wart",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:beetroot",Count:1b,tag:{display:{Name:'{"text":"Pickled Beet","italic":false}'},picklebeet:3b,CustomModelData:1}}}
execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:beetroot",Count:1b}}] at @s run execute as @e[type=item,tag=!plus,nbt={Item:{id:"minecraft:baked_potato",Count:1b}},distance=0..1,limit=1,sort=nearest] at @s run summon minecraft:item ~ ~ ~ {Tags:["newitem","plus"],Item:{id:"minecraft:baked_potato",Count:1b,tag:{display:{Name:'{"text":"Red Latkes","italic":false}'},latkes:3b,CustomModelData:1}}}
##each ingredient needs this command once##
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:apple",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:carrot",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:beetroot",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:baked_potato",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:honey_bottle",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:nether_wart",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:bread",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_beef",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_chicken",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_cod",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_mutton",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_porkchop",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_salmon",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:dried_kelp",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:cooked_rabbit",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:sweet_berries",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:sugar",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:egg",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run kill @e[tag=!plus,type=item,nbt={Item:{id:"minecraft:melon_slice",Count:1b}},distance=0..2,limit=1,sort=nearest]
execute as @e[tag=newitem] at @s run playsound minecraft:entity.player.levelup ambient @a
execute as @e[tag=newitem] at @s run particle minecraft:effect ~ ~ ~ .2 .2 .2 0 20
execute as @e[tag=newitem] run tag @s remove newitem
execute as @e[tag=bottle] at @s run summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:glass_bottle",Count:1b}}
execute as @e[tag=bottle] run tag @s remove bottle
Maybe I am misunderstanding what you are asking, but can you not just use the saturation effect instead of the regeneration effect?
I can use any effect but the effect wont trigger, I am trying to figure out why.
Any one can help get the effect to trigger?
Are you sure it is not working? When I run a subset of your commands (see below) I get the regeneration effect after eating a beef sandwich
Tick:
Load:
Did you run in 1.16.3? I think I forgot to put that.
Odd I ran yours and it worked but mine still does not.
Yes, I presumed that you were using 1.16.3, so that is what I used. How exactly is your code failing? Is it only the effect part that is not working, or are the functions not working at all?
every thing but the effect fails, i can make the food, they look right, there named right, they have the right tags, but eating them is normal no effect added.
And you are sure it is not something silly like the effect not being noticeable because it only lasts for 1 second? Otherwise I am afraid I have no clue why it is not working.
I am sure, in my test world, I disabled natural health regen. So any health must come from the food, your code worked, mine still does not. I am trying to simplify the code, to make it so less functions need to be repeated.
So with more testing and trying random things, I found beef still works, but nothing else does.
Where does beef_delay 2 become beef_delay 1? It looks like you set the tag to 2 but then look for it set to 1.