Interface INPC

All Superinterfaces:
net.runelite.api.Actor, net.runelite.api.CameraFocusableEntity, IActor, Identifiable, Interactable, Locatable, Nameable, net.runelite.api.Node, net.runelite.api.NPC, net.runelite.api.Renderable, RuneLiteWrapper<net.runelite.api.Actor>, SceneEntity, Transformable<net.runelite.api.NPCComposition>

public interface INPC extends net.runelite.api.NPC, IActor, Transformable<net.runelite.api.NPCComposition>
Represents a non-player character (NPC) in the game world.

NPCs are actors controlled by the game. This interface extends IActor and provides NPC-specific functionality such as overhead icons and transformations.

Example usage:

 
 INPCs npcs = Static.getNpcs();
 INPC banker = npcs.nearest("Banker");
 if (banker != null) {
     banker.interact("Bank");
     NPCComposition composition = banker.transform();
 }
 
 

See Also:
  • Method Details

    • getOverheadIcons

      net.runelite.api.HeadIcon[] getOverheadIcons()
      Gets all overhead icons displayed above the NPC.

      Overhead icons include prayer protection icons, skull icons, etc.

      Returns:
      array of overhead icons (may be empty)
    • update

      void update(net.runelite.api.NPC npc)
      Updates this NPC's state with data from a RuneLite NPC object.

      This is an internal method used to sync NPC data.

      Parameters:
      npc - the RuneLite NPC object
    • getOverheadIcon

      default net.runelite.api.HeadIcon getOverheadIcon()
      Gets the primary overhead icon, if any.

      This is a convenience method that returns the first overhead icon.

      Returns:
      the first overhead icon, or null if none exist