"When Food Eaten" trigger?

Started by Valirane on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Mar 2022
Points:
394

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 65
"When Food Eaten" trigger?

I'm trying to make a procedure that triggers after food is eaten.  I figured that there would be some sort of trigger for this but couldn't find one.  I searched the forum topics and found several references that such a trigger does indeed exist.  What am I missing?  Is this not currently supported in the latest snapshot?

Active 1 year ago
Joined Jul 2020
Points:
669

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 105
When item used
Mon, 05/02/2022 - 10:14

When item used

Active 2 years ago
Joined Mar 2022
Points:
394

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 65
That can work, but I'd need…
Mon, 05/02/2022 - 23:36

That can work, but I'd need to add a check for if the item was Food.  Not sure why there isn't a global trigger for Food.  I was able to make one with a simple code edit.  I used "Player finishes using item" as the base global trigger for my procedure.  Once that was complete, I edited the following:

public static void onUseItemFinish

to 

public static void onFoodEaten