Interface IInventoryItem
- All Superinterfaces:
Identifiable,IItem,Interactable,Nameable,RuneLiteWrapper<net.runelite.api.Item>
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:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddrop()Drops this item from the inventory.voiduse()Activates the "Use" action on this item.voidUses this item on an actor (NPC or player) in the game world.voiduseOn(Interactable interactable) Uses this item on any interactable game entity.voidUses this item on another item in the inventory.voidUses this item on a ground item (tile item).voiduseOn(ITileObject tileObject) Uses this item on a tile object in the game world.voidUses this item on a widget element.Methods inherited from interface net.storm.api.domain.Identifiable
getIdMethods inherited from interface net.storm.api.domain.items.IItem
getComposition, getNotedId, getQuantity, getSlot, getSubOptionIndex, getSubOptions, getWidget, hasSubOption, isMembers, isNoted, isPlaceholder, isStackable, isTradable, setWidgetMethods 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
-
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
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
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
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
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
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
Uses this item on any interactable game entity.This is a general-purpose method that can target any entity implementing the
Interactableinterface.- 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.
-