Need help: Is there a 'when item consumed by player/entity' procedure block?

Started by Nanocry on

Topic category: Help with MCreator software

Last seen on 18:11, 17. Dec 2021
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help: Is there a 'when item consumed by player/entity' procedure block?
Tue, 03/03/2020 - 20:26 (edited)

Im just wondering, because i have and advancement that I want to trigger if the player has eaten one of the many foods in my mod. Can someone help with this?

EDIT: I know there is a procedure block in the advancement editor, but I cant find one in the procedure editor, and I need more than one condition like (pseudocode)

if <item>, or <item>.... consumed: trigger the advancement: '<namehere>'

idk how to code in java, or even code in java for Minecraft none the less, but i would really apreciate some help on this! 

Edited by Nanocry on Tue, 03/03/2020 - 20:26
Last seen on 18:11, 17. Dec 2021
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
May have found a way around…
Tue, 03/03/2020 - 20:33

May have found a way around this via global variables, but I just wondered if there was a way to do this without trying to be clever like that? QOF stuff ya know?

Last seen on 13:40, 13. Jun 2024
Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know i am MANY months late…
Wed, 09/02/2020 - 12:24

I know i am MANY months late to ask this but is there a possibility you could help me? i have some idea about setting the global variable to a consumable item but i have no idea on how to make it affect you when eaten.

Last seen on 02:46, 22. Sep 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I had a bit of troubles with…
Tue, 05/25/2021 - 09:44

I had a bit of troubles with this, but I made a procedure that activates when the player finishes using an item.

If Provided Itemstack = {Food Item}
Set {Player Persistent Global Number Variable} to {Whatever number you want that isn't zero}

and then a procedure that activates every tick for the player

If {Player Persistent Global Number Variable} = {Desired Number}
Set {Player Persistent Global Number Variable} to 0
Apply potion effects