Check when player is eating food

Started by Mido-shonun on

Topic category: User side tutorials

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check when player is eating food
Sun, 09/29/2024 - 21:28 (edited)

I've seen things about how to make custom food do things after eating it, but could not find anything on normal Minecraft foods.

this is pretty important to my mod, since its Tokyo Ghoul. Unfortunately, I had to figure it out on my own.

it was pretty easy:

 

Make the event trigger "player finishes using item"  (in a normal procedure)

Check what the "Provided Itemstack" is, and set it to whatever foods you want.

From there, make it do what you want.

the only issue is that you have to put each food in one by one. this is what's used in my Tokyo Ghoul mod

 

Edited by Mido-shonun on Sun, 09/29/2024 - 21:28
Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To solve the issue of…
Sun, 10/27/2024 - 19:10

To solve the issue of putting in foods one by one, you can create an item element tag with namespace (ex: "namespace") and name (ex: "tag_name") and then use Is Provided Itemstack tagged in item tags as 'namespace:tag_name'

For all foods, you can even use Get food value of Provided Item Stack and check if it is positive. (For some reason, this will trigger ominous bottles)

Unfortunately, neither of these methods work with cake.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Correction: you will still…
Sun, 10/27/2024 - 19:12

Correction: you will still have to put the foods into the item tag one by one, but it will be significantly less tedious than doing it in a procedure.