Interface IInventoryItem

All Superinterfaces:
Identifiable, IItem, Interactable, Nameable, RuneLiteWrapper<net.runelite.api.Item>

public interface IInventoryItem extends IItem
Represents an item in the player's inventory with full interaction capabilities.

This interface extends IItem with methods specific to inventory items, including the ability to use items on various game entities. Inventory items can be used, combined with other items, applied to game objects, or dropped.

Common use cases:

  • Using consumable items (food, potions)
  • Combining items (herblore, fletching)
  • Using items on game objects (keys on doors, ores on furnaces)
  • Using items on NPCs or players
  • Dropping items

See Also:
  • IItem
  • invalid reference
    IInventory
  • Method Details

    • use

      void use()
      Activates the "Use" action on this item.

      This prepares the item to be used on another entity. After calling this, the item will be selected and clicking on a valid target will complete the "use X on Y" action.

    • useOn

      void useOn(IItem item)
      Uses this item on another item in the inventory.

      This is commonly used for combining items, such as using a knife on logs for fletching, or using a pestle on ingredients for herblore.

      Parameters:
      item - the target item to use this item on
    • useOn

      void useOn(ITileObject tileObject)
      Uses this item on a tile object in the game world.

      Examples include using ore on a furnace, using a key on a door, or using a bucket on a well.

      Parameters:
      tileObject - the target tile object to use this item on
    • useOn

      void useOn(IActor actor)
      Uses this item on an actor (NPC or player) in the game world.

      Examples include using food on another player, using items on NPCs for quests, or using special items on monsters.

      Parameters:
      actor - the target actor to use this item on
    • useOn

      void useOn(IWidget widget)
      Uses this item on a widget element.

      This allows using items on interface elements, such as using items on specific UI components or spell icons.

      Parameters:
      widget - the target widget to use this item on
    • useOn

      void useOn(ITileItem tileItem)
      Uses this item on a ground item (tile item).

      This allows using inventory items on items that are on the ground.

      Parameters:
      tileItem - the target ground item to use this item on
    • useOn

      void useOn(Interactable interactable)
      Uses this item on any interactable game entity.

      This is a general-purpose method that can target any entity implementing the Interactable interface.

      Parameters:
      interactable - the target entity to use this item on
    • drop

      void drop()
      Drops this item from the inventory.

      The item will be placed on the ground at the player's current location. Note that some items cannot be dropped and must be destroyed instead.