Do an action if n of items are in inventory

Started by Gabriele007 on Wed, 12/08/2021 - 01:46

Topic category: Help with modding (Java Edition)

Last seen on 22:48, 17. Jan 2022
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Do an action if n of items are in inventory
Wed, 12/08/2021 - 01:46

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 20:19, 28. Jan 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 22:48, 17. Jan 2022
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 17:50, 5. Jan 2022
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 22:48, 17. Jan 2022
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.