Class InventoryEntity

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean combineWith​(ContainerItem other)
      Uses one inventory item on another.
      boolean drop()
      Drops the item from the inventory.
      int getId()
      The item ID for the wrapped game entity
      java.lang.String getName()
      The game entities name.
      boolean hasAction​(java.lang.String action)
      Returns true if the inventory item has the specified action.
      boolean interact​(java.lang.String action)
      Interacts with the entity using the given action verb.
      boolean useOn​(ContainerItem other)
      Uses one item in the inventory on the other.
      boolean useOn​(net.runelite.api.GameObject gameObject)
      Uses one item in the inventory on a Game object.
      boolean useOn​(net.runelite.api.NPC npc)
      Uses one item in the inventory on an NPC.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Interactable
        The game entities name.
        Returns:
        The name of the game entity i.e. NPC name for NPC's, item name for ContainerItem's, and GameObject name for various game objects.
      • interact

        public boolean interact​(java.lang.String action)
        Description copied from interface: Interactable
        Interacts with the entity using the given action verb.
        Parameters:
        action - The menu action to trigger (e.g., "Attack", "Talk-to", "Take")
        Returns:
        true if the interaction packet was successfully queued/sent
      • getId

        public int getId()
        Description copied from interface: Interactable
        The item ID for the wrapped game entity
        Returns:
        int Item id
      • hasAction

        public boolean hasAction​(java.lang.String action)
        Returns true if the inventory item has the specified action. i.e "Swordfish" will have the action "Eat", "Drop", and "Examine" but not "Drink"
        Parameters:
        action - The action to check for
        Returns:
        True if the item has the action and false otherwise
      • combineWith

        public boolean combineWith​(ContainerItem other)
        Uses one inventory item on another.
        Parameters:
        other - The other inventory item to be used on.
        Returns:
        True if the combination action was successful and false otherwise
      • useOn

        public boolean useOn​(ContainerItem other)
        Uses one item in the inventory on the other. This is a shallow wrapper around combineWith()
        Parameters:
        other - The other inventory item to be used on.
        Returns:
        True if the use on item was successful and false otherwise
      • useOn

        public boolean useOn​(net.runelite.api.NPC npc)
        Uses one item in the inventory on an NPC.
        Parameters:
        npc - The NPC to use the inventory item on.
        Returns:
        True if the use on item was successful and false otherwise
      • useOn

        public boolean useOn​(net.runelite.api.GameObject gameObject)
        Uses one item in the inventory on a Game object.
        Parameters:
        gameObject - The GameObject to use the inventory item on.
        Returns:
        True if the use on item was successful and false otherwise
      • drop

        public boolean drop()
        Drops the item from the inventory.
        Returns:
        True if the item was successfully dropped, false otherwise.