How to check the number of items in an inventory

Started by madcock83 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check the number of items in an inventory

Looking to check how many of a certain item are in the players inventory then do something. I posted this question a while back. Someone answered it with a link to an old forum post. Before I saw it the post was removed. Any help would be awesome.

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
while player has it: remove…
Sat, 06/06/2020 - 05:29

while player has it:

remove 1 of it in inventory

add cound by 1

end while

add (count) item "it" to inventory

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
grammar fix: cound = count
Sat, 06/06/2020 - 05:29

grammar fix:

cound = count

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
grammar fix: spelling* 
Thu, 01/20/2022 - 11:47

grammar fix:

spelling* 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Lord Of The D 42 (I am now…
Sun, 01/23/2022 - 12:58

@Lord Of The D 42
(I am now a pro programmer)
There's no such thing as grammer or spelling, only SYNTAX

There's literally procedure…
Sun, 01/23/2022 - 13:01

There's literally procedure template for that. Check for "check how many diamonds are in inventory" template, it can be used for any item.

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Toma400 this is an…
Sun, 01/23/2022 - 13:04

@Toma400 this is an extremely old post okay?

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Toma400 its not showing for…
Sun, 03/10/2024 - 20:21

Toma400 its not showing for me