Number of Items in Inventory

Started by Jdzrowskyy on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 week ago
Joined Feb 2022
Points:
542

User statistics:

  • Modifications: 1
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
Number of Items in Inventory

i need this, and procedure template for that isn,t working for me

Active 1 month ago
Joined May 2022
Points:
1291

User statistics:

  • Modifications: 15
  • Forum topics: 25
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1143
If you need the total number…
Fri, 12/08/2023 - 12:53

If you need the total number of items in the player's inventory, you can pretty easily make a procedure that does this. Just make two local number variables, one called "slot_number," and one called "sum." 

Then, have a procedure that repeats 36 times, (the number of inventory slots), each time checking the item in "slot_number" then adding +1 to "slot_number," (so it checks the next inventory slot), and adding to "sum" based on the number of items in the current slot.