(Solved) How do I check when player eats vanilla food?

Started by pylonuclear on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(Solved) How do I check when player eats vanilla food?
Thu, 10/29/2020 - 00:23 (edited)

I am planning to make a mod that makes it to where when you eat chicken, it give you a wishbone.  Does anyone know how this can be achieved, or even if it can be achieved?  Thanks in Advance!

Edited by pylonuclear on Thu, 10/29/2020 - 00:23
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a global trigger…
Mon, 07/20/2020 - 19:15

There is a global trigger named "Player right clicks with item". I think if you check if chicken is in the main hand of the player you can do something.

Or you can try to replace the vanilla chicken (item) by creating a new one and replacing the chicken (creature) loot table with your chicken (item). If you do that you can use the "when food eaten" food event.

I think the easyest way is the second one :3

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
in any case you will need a…
Tue, 07/21/2020 - 00:22

in any case you will need a IF for each vanilla food. or one IF that includes them all

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For those of you who find…
Fri, 08/28/2020 - 17:15

For those of you who find this post and want to know the best answer, I think I figured out the best solution.  
 

You make an advancement (hide it from the player if you wish)

There is a trigger in the achievements where you can select the food you want to detect, and then you can add your custom item into the loot table of the advancement.  So if you eat the food, it will give you the item(s) you wish.