How to check the number of items in an inventory

Started by madcock83 on

Topic category: Help with modding (Java Edition)

Last seen on 01:58, 23. Nov 2021
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.

Last seen on 06:33, 1. May 2023
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

Last seen on 06:33, 1. May 2023
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

Last seen on 08:35, 19. Nov 2023
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* 

Last seen on 06:33, 1. May 2023
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.

Last seen on 06:33, 1. May 2023
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?

Last seen on 12:57, 29. Mar 2024
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