"When Food Eaten" trigger?

Started by Valirane on

Topic category: Help with modding (Java Edition)

Last seen on 05:05, 30. Oct 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"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?

Last seen on 17:59, 7. Jan 2024
Joined Jul 2020
Points:

User statistics:

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

When item used

Last seen on 05:05, 30. Oct 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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