Do an action if n of items are in inventory

Started by Gabriele007 on

Topic category: Help with Minecraft modding (Java Edition)

Active 10 months ago
Joined Sep 2021
Points:
535

User statistics:

  • Modifications: 3
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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.

Active 3 years ago
Joined Nov 2021
Points:
463

User statistics:

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

Here it shoud work with this procedure

"."

Active 10 months ago
Joined Sep 2021
Points:
535

User statistics:

  • Modifications: 3
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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?

Active 1 year ago
Joined Mar 2019
Points:
807

User statistics:

  • Modifications: 3
  • Forum topics: 12
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 130
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.

Active 10 months ago
Joined Sep 2021
Points:
535

User statistics:

  • Modifications: 3
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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.