Package net.runelite.api
Interface ItemContainer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(int itemId)
Check if this item container contains the given itemint
count()
Get the total number of filled slots in the item container.int
count(int itemId)
Counts how many of an item this item container containsint
find(int itemId)
Find the first index of an item in the containerint
getId()
Get the item container idItem
getItem(int slot)
Gets an item from the container at the given slot.Item[]
getItems()
Gets an array of all items in the container.int
size()
Get the number of slots in this item container.-
Methods inherited from interface net.runelite.api.Node
getHash, getNext, getPrevious
-
-
-
-
Method Detail
-
getId
int getId()
Get the item container id- Returns:
- See Also:
InventoryID
-
getItems
@Nonnull Item[] getItems()
Gets an array of all items in the container.- Returns:
- the items held
-
getItem
@Nullable Item getItem(int slot)
Gets an item from the container at the given slot.- Parameters:
slot
-- Returns:
- the item
- See Also:
Item
-
contains
boolean contains(int itemId)
Check if this item container contains the given item- Parameters:
itemId
-- Returns:
- See Also:
ItemID
-
count
int count(int itemId)
Counts how many of an item this item container contains- Parameters:
itemId
-- Returns:
- See Also:
ItemID
-
size
int size()
Get the number of slots in this item container. This includes empty slots. For example for the player inventory it can be 28 even with no items in the inventory.- Returns:
- See Also:
to get the number of filled slots instead
-
count
int count()
Get the total number of filled slots in the item container.- Returns:
-
find
int find(int itemId)
Find the first index of an item in the container- Parameters:
itemId
- the item- Returns:
- the item index, or -1 if not found
-
-