Interface IItem
- All Superinterfaces:
Identifiable,Interactable,Nameable,RuneLiteWrapper<net.runelite.api.Item>
- All Known Subinterfaces:
IBankInventoryItem,IBankItem,IInventoryItem
This is the base interface for all item types in the Storm API. It provides access to item metadata, properties, and interaction capabilities. Items can exist in various containers such as inventory, bank, equipment, or trade windows.
Key features:
- Access to item ID, name, and quantity
- Item composition data (from game cache)
- Widget information for UI interactions
- Item properties like noted status, stackability, and tradability
- Sub-option menu access for complex item interactions
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnet.runelite.api.ItemCompositionGets the item's composition data from the game cache.intGets the noted variant ID of this item.intGets the quantity (stack size) of this item.intgetSlot()Gets the slot index where this item is located in its container.int[]getSubOptionIndex(String option) Gets the index path to a specific sub-option.String[][]Gets all sub-options (nested menu options) for this item.Gets the widget that displays this item in the UI.booleanhasSubOption(String option) Checks if this item has a specific sub-option available.booleanChecks if this item is members-only.booleanisNoted()Checks if this item is in noted form.booleanChecks if this item is a bank placeholder.booleanChecks if this item is stackable.booleanChecks if this item can be traded with other players.voidSets the widget reference for this item.Methods inherited from interface net.storm.api.domain.Identifiable
getIdMethods inherited from interface net.storm.api.domain.Interactable
generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, getActionIndex, getActions, getClickPoint, hasAction, hasAction, hasAction, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, isInteractable, isInteractable, isInteractableMethods inherited from interface net.storm.api.domain.RuneLiteWrapper
getWrapped
-
Method Details
-
getComposition
net.runelite.api.ItemComposition getComposition()Gets the item's composition data from the game cache.The composition contains detailed information about the item including its name, examine text, model information, and various item flags.
- Returns:
- the item's
ItemComposition, ornullif unavailable
-
getSlot
int getSlot()Gets the slot index where this item is located in its container.For inventory items, this is 0-27. For equipment, this corresponds to the equipment slot. For bank items, this is the position in the bank.
- Returns:
- the slot index of this item
-
getWidget
IWidget getWidget()Gets the widget that displays this item in the UI.- Returns:
- the
IWidgetrepresenting this item, ornullif not visible
-
setWidget
Sets the widget reference for this item.Internal usage only. Do not call this method directly.
- Parameters:
widget- the widget to associate with this item
-
getQuantity
int getQuantity()Gets the quantity (stack size) of this item.- Returns:
- the number of items in this stack
-
isPlaceholder
boolean isPlaceholder()Checks if this item is a bank placeholder.Placeholders are empty slots in the bank that reserve a position for a specific item type when the actual items have been withdrawn.
- Returns:
trueif this item is a placeholder,falseotherwise
-
getNotedId
int getNotedId()Gets the noted variant ID of this item.Returns the item ID of the noted form if this item can be noted, or -1 if the item cannot be noted.
- Returns:
- the noted item ID, or -1 if not noteable
-
isNoted
boolean isNoted()Checks if this item is in noted form.Noted items are paper representations of items that always stack, used for carrying large quantities of non-stackable items.
- Returns:
trueif the item is noted,falseotherwise
-
isStackable
boolean isStackable()Checks if this item is stackable.Stackable items can have multiple items in a single inventory slot. Examples include coins, runes, and arrows.
- Returns:
trueif the item stacks,falseotherwise
-
isTradable
boolean isTradable()Checks if this item can be traded with other players.- Returns:
trueif the item is tradable,falseotherwise
-
isMembers
boolean isMembers()Checks if this item is members-only.- Returns:
trueif the item requires membership,falseotherwise
-
getSubOptions
String[][] getSubOptions()Gets all sub-options (nested menu options) for this item.Sub-options appear in nested menus, such as "Spellbook" options on certain items. The returned array is two-dimensional where each inner array represents the options at that menu level.
- Returns:
- a 2D array of sub-option strings, or an empty array if none exist
-
hasSubOption
Checks if this item has a specific sub-option available.- Parameters:
option- the sub-option text to check for (case-sensitive)- Returns:
trueif the sub-option exists,falseotherwise
-
getSubOptionIndex
Gets the index path to a specific sub-option.The returned array contains indices that specify the path through nested menus to reach the specified option.
- Parameters:
option- the sub-option text to find (case-sensitive)- Returns:
- an array of indices representing the path to the option,
or
nullif the option is not found
-