Package net.storm.sdk.entities
Class NPCs
java.lang.Object
net.storm.sdk.entities.NPCs
Static utility class for querying and interacting with NPCs.
Provides convenient access to all NPCs in the loaded scene. NPCs include monsters, shopkeepers, bankers, and other non-player characters.
Example usage:
// Find nearest banker
INPC banker = NPCs.getNearest("Banker");
if (banker != null) {
banker.interact("Bank");
}
// Find all goblins
List<INPC> goblins = NPCs.getAll("Goblin");
// Query with filters
INPC target = NPCs.query()
.names("Goblin", "Imp")
.alive()
.nearest();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic INPCget(int index) Gets an NPC by its index in the NPC array.getAll()Gets all NPCs in the loaded scene.getAll(int... ids) Gets all NPCs with any of the specified IDs.Gets all NPCs with any of the specified names.Gets all NPCs matching a filter.static INPCGets the NPC with the hint arrow pointing to it.static INPCgetNearest(int... ids) Gets the nearest NPC to the local player with any of the specified IDs.static INPCgetNearest(String... names) Gets the nearest NPC to the local player with any of the specified names.static INPCgetNearest(Predicate<? super INPC> filter) Gets the nearest NPC to the local player matching a filter.static INPCgetNearest(net.runelite.api.coords.WorldPoint worldPoint, int... ids) Gets the nearest NPC to a point with any of the specified IDs.static INPCgetNearest(net.runelite.api.coords.WorldPoint worldPoint, String... names) Gets the nearest NPC to a point with any of the specified names.static INPCgetNearest(net.runelite.api.coords.WorldPoint worldPoint, Predicate<? super INPC> filter) Gets the nearest NPC to a point matching a filter.static NPCQueryquery()Creates a new NPC query for fluent filtering.static NPCQueryCreates a new NPC query with a custom supplier.
-
Constructor Details
-
NPCs
public NPCs()
-
-
Method Details
-
query
Creates a new NPC query for fluent filtering.- Returns:
- a new NPC query
-
query
Creates a new NPC query with a custom supplier.- Parameters:
supplier- the NPC supplier- Returns:
- a new NPC query
-
get
Gets an NPC by its index in the NPC array.- Parameters:
index- the NPC index- Returns:
- the NPC, or null if not found
-
getAll
Gets all NPCs in the loaded scene.- Returns:
- list of all NPCs
-
getAll
Gets all NPCs matching a filter.- Parameters:
filter- the predicate to match- Returns:
- list of matching NPCs
-
getAll
Gets all NPCs with any of the specified IDs.- Parameters:
ids- the NPC IDs to match- Returns:
- list of matching NPCs
-
getAll
Gets all NPCs with any of the specified names.- Parameters:
names- the NPC names to match- Returns:
- list of matching NPCs
-
getNearest
public static INPC getNearest(net.runelite.api.coords.WorldPoint worldPoint, Predicate<? super INPC> filter) Gets the nearest NPC to a point matching a filter.- Parameters:
worldPoint- the reference pointfilter- the predicate to match- Returns:
- the nearest matching NPC, or null if none found
-
getNearest
Gets the nearest NPC to a point with any of the specified IDs.- Parameters:
worldPoint- the reference pointids- the NPC IDs to match- Returns:
- the nearest matching NPC, or null if none found
-
getNearest
Gets the nearest NPC to a point with any of the specified names.- Parameters:
worldPoint- the reference pointnames- the NPC names to match- Returns:
- the nearest matching NPC, or null if none found
-
getNearest
Gets the nearest NPC to the local player matching a filter.- Parameters:
filter- the predicate to match- Returns:
- the nearest matching NPC, or null if none found
-
getNearest
Gets the nearest NPC to the local player with any of the specified names.- Parameters:
names- the NPC names to match- Returns:
- the nearest matching NPC, or null if none found
-
getNearest
Gets the nearest NPC to the local player with any of the specified IDs.- Parameters:
ids- the NPC IDs to match- Returns:
- the nearest matching NPC, or null if none found
-
getHintArrowed
Gets the NPC with the hint arrow pointing to it.- Returns:
- the hint arrowed NPC, or null if none
-