Interface IItem

All Superinterfaces:
Identifiable, Interactable, Nameable, RuneLiteWrapper<net.runelite.api.Item>
All Known Subinterfaces:
IBankInventoryItem, IBankItem, IInventoryItem

public interface IItem extends Interactable, Identifiable, Nameable, RuneLiteWrapper<net.runelite.api.Item>
Represents an item in the game with full access to its properties and interactions.

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 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, or null if 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 IWidget representing this item, or null if not visible
    • setWidget

      void setWidget(IWidget widget)
      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:
      true if this item is a placeholder, false otherwise
    • 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:
      true if the item is noted, false otherwise
    • 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:
      true if the item stacks, false otherwise
    • isTradable

      boolean isTradable()
      Checks if this item can be traded with other players.
      Returns:
      true if the item is tradable, false otherwise
    • isMembers

      boolean isMembers()
      Checks if this item is members-only.
      Returns:
      true if the item requires membership, false otherwise
    • 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

      boolean hasSubOption(String option)
      Checks if this item has a specific sub-option available.
      Parameters:
      option - the sub-option text to check for (case-sensitive)
      Returns:
      true if the sub-option exists, false otherwise
    • getSubOptionIndex

      int[] getSubOptionIndex(String option)
      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 null if the option is not found