Interface INPCs

All Superinterfaces:
EntityProvider<INPC>, SceneEntityProvider<INPC>

public interface INPCs extends SceneEntityProvider<INPC>
Provides access to all NPCs (Non-Player Characters) in the loaded scene.

This interface extends SceneEntityProvider to provide NPC-specific querying capabilities, including methods to retrieve NPCs by index or find the hint-arrowed NPC. NPCs are cached and updated each game tick to ensure consistency.

The provider maintains a cache of all visible NPCs in the current world view, allowing efficient queries without repeatedly accessing the underlying game data.

Example usage:

 
 INPCs npcs = Static.getNpcs();

 // Find the nearest banker
 INPC banker = npcs.getNearest("Banker");

 // Get all goblins
 List<INPC> goblins = npcs.getAll("Goblin");

 // Get NPC by index (from server)
 INPC npc = npcs.get(1234);

 // Get the hint-arrowed NPC (quest helper indicator)
 INPC hinted = npcs.getHintArrowed();
 
 

See Also:
  • Method Details

    • getHintArrowed

      INPC getHintArrowed()
      Gets the NPC that currently has the hint arrow pointing to it.

      The hint arrow is typically used by the game to indicate quest-related NPCs or other important characters that the player should interact with.

      Returns:
      the hint-arrowed NPC, or null if no NPC has a hint arrow
    • get

      INPC get(int index)
      Gets an NPC by its server-assigned index.

      Each NPC in the game has a unique index assigned by the server. This method retrieves the cached NPC wrapper for the given index. The index is different from the NPC's definition ID (which identifies the NPC type).

      Parameters:
      index - the server-assigned NPC index
      Returns:
      the NPC at the given index, or null if no NPC exists at that index