Do an action if n of items are in inventory

Started by Gabriele007 on

Topic category: Help with modding (Java Edition)

Last seen on 09:00, 3. Aug 2023
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.

Last seen on 18:15, 15. Feb 2022
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

"."

Last seen on 09:00, 3. Aug 2023
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?

Last seen on 00:34, 20. Aug 2023
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.

Last seen on 09:00, 3. Aug 2023
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.