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

Discussion in 'Developer Support' started by placebo, Jul 26, 2016.

  1. 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.
  2. 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.
    placebo and Serene like this.
  3. but Inventory.getQuantity(x) (if unstackable) will return the used slots?
  4. I'd just do Inventory.getItems().size() for what you're trying to accomplish there.
  5. No, that will return the total quantity of x.
    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()

Share This Page