How can I get count of spesific item in players inventory?

Started by alparda112 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I get count of spesific item in players inventory?

Hello,

So I made a "weight" item and the amount of this item in a players inventory is important for me. But I can't find a way to count the number of  item:weight in  players inventory...  I searched a lot but couldn't find anything about this topic. Help is appreciated a lot. 

Use for each item in entity…
Fri, 02/12/2021 - 10:03

Use for each item in entity inventory and check if item is of desired type, and if it is, increment local variable storing count for the stack size of the itemstack iterator

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Klemen Can You Send A Photo…
Sun, 05/08/2022 - 09:55

@Klemen Can You Send A Photo Of Procedure ?