Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Inventory.getItems(x).first().getQuantity()

Joined
Jul 23, 2016
Messages
3
item = Inventory.getItems(x).first();

itemQuant = item.getQuantity();

what will be returned in itemQuant?
Will it return "1" because item is .first or all of the same type ex. "28".

so itemQuant would be equal to Inventory.getQuantity(x)?
currently cant execute because i get the " gamepack is being processed " bug.
 
s̶c̶r̶i̶p̶t̶ bot*
Joined
Aug 23, 2015
Messages
2,232
Inventory.getItems(x).first().getQuantity() should return the quantity number of the item. So if it was a stackable item, it'd return the amount of items within the stack.
 
Joined
Dec 10, 2014
Messages
3,332
but Inventory.getQuantity(x) (if unstackable) will return the used slots?
No, that will return the total quantity of x.
I'd just do Inventory.getItems().size() for what you're trying to accomplish there.
This is probably the best solution to finding how many slots are used, and if you want how many slots are used by x you'd want to use Inventory.getItems(x).size()
 
Top