How to detect when player eats an item

Started by BlaBlaSillySheep on Wed, 09/02/2020 - 16:35

Topic category: Help with modding (Java Edition)

Last seen on 23:28, 23. Oct 2020
Joined Apr 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to detect when player eats an item
Wed, 09/02/2020 - 23:47 (edited)

Hey there! I'm trying to make it so that if the player has an NBT tag they wont be able to eat normal food (porkchops, steak etc) without getting potion effects. At first i thought global variables would work, but i need it to detect if the player has eaten the food so i can add the effects.

I could make it so that when the player right clicks on food, it dissapears and adds potion effects but thats kinda stopped the eating animation all together. 

Any ideas? (Wether its custom code or procedure i dont mind, just some ideas would be nice)

Stay Safe!

 

Edit: its been 2 days with no response, please, i need it for my mod, i even credit the people who i get ideas and tips from on my github.

Edited by BlaBlaSillySheep on Wed, 09/02/2020 - 23:47
Last seen on 23:28, 23. Oct 2020
Joined Apr 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you!
Thu, 09/03/2020 - 14:06

Thank you!

Last seen on 23:28, 23. Oct 2020
Joined Apr 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I am not seeing the "When…
Thu, 09/03/2020 - 14:25

I am not seeing the "When player finishes using item" is this a plugin?

Last seen on 16:37, 24. Oct 2020
Joined Feb 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
yes it is  
Fri, 10/02/2020 - 20:28

yes it is