Counting amount of items

Started by MrCreeps on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Counting amount of items

Hello, is there a way to count the amount of specific items in a player's inventory  and return a value? For example, count the amount of arrows, spectral arrows, or tipped arrows and then add 1 to a number variable. If so, can you please explain how to make it. I tried to make it but it counts every tick, but I haven't been able to work without the 'on player tick' global trigger. Here is a  link to an image of the current procedure - Ammo Count Procedure - Imgur

Thanks :)

Use local variable to store…
Mon, 12/07/2020 - 07:53

Use local variable to store count and use for each item in inventory loop to check all slots and sum the count in the local variable

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i do that? i…
Wed, 01/14/2026 - 07:15

how do i do that? i currently have this
https://imgur.com/e3Kp8AS
and would like it to find if there is 50 total, and then take 50 total from the inventory instead of just taking all of one stack that is less than 50 and not taking the rest it needs