Number of Items in Inventory

Started by Jdzrowskyy on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Number of Items in Inventory

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

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.