Do an action if n of items are in inventory

Started by Gabriele007 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do an action if n of items are in inventory

How can i make that if i have 8 apples in my inventoy for example, do an action? I know that there is the "has event/target entity in inventory (item)" block, but that doesn't check for the amout.

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here it shoud work with this…
Wed, 12/08/2021 - 11:19

Here it shoud work with this procedure

"."

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, i will try this…
Wed, 12/08/2021 - 13:55

Thanks, i will try this later.

Also, how can i know the number of a specific item the player has in inventory, and use the same number somewhere else?

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global Variables. Change…
Wed, 12/08/2021 - 14:37

Global Variables. Change them in procedures and you can usually get the updated value in another.

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Good hint. I think i will…
Wed, 12/08/2021 - 15:49

Good hint. I think i will use while this item is in inventory tick + global variables.