Package net.storm.sdk.entities
Class Players
java.lang.Object
net.storm.sdk.entities.Players
Static utility class for querying and interacting with players.
Provides convenient access to all players in the loaded scene, including the local player (your character).
Example usage:
// Get your player
IPlayer local = Players.getLocal();
String myName = local.getName();
// Find nearby players
List<IPlayer> nearbyPlayers = Players.getAll();
// Query with filters
IPlayer target = Players.query()
.filter(p -> p.getCombatLevel() < 50)
.nearest();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IPlayerget(int index) Gets a player by index in the player array.getAll()Gets all players in the loaded scene.getAll(int... ids) Gets all players with any of the specified IDs.Gets all players with any of the specified names.Gets all players matching a filter.static IPlayerGets the player with the hint arrow pointing to them.static IPlayergetLocal()Gets the local player (your character).static IPlayergetNearest(int... ids) Gets the nearest player to the local player with any of the specified IDs.static IPlayergetNearest(String... names) Gets the nearest player to the local player with any of the specified names.static IPlayergetNearest(Predicate<? super IPlayer> filter) Gets the nearest player to the local player matching a filter.static IPlayergetNearest(net.runelite.api.coords.WorldPoint worldPoint, int... ids) Gets the nearest player to a point with any of the specified IDs.static IPlayergetNearest(net.runelite.api.coords.WorldPoint worldPoint, String... names) Gets the nearest player to a point with any of the specified names.static IPlayergetNearest(net.runelite.api.coords.WorldPoint worldPoint, Predicate<? super IPlayer> filter) Gets the nearest player to a point matching a filter.static PlayerQueryquery()Creates a new player query for fluent filtering.static PlayerQueryCreates a new player query with a custom supplier.
-
Constructor Details
-
Players
public Players()
-
-
Method Details
-
query
Creates a new player query for fluent filtering.- Returns:
- a new player query
-
query
Creates a new player query with a custom supplier.- Parameters:
supplier- the player supplier- Returns:
- a new player query
-
get
Gets a player by index in the player array.- Parameters:
index- the player index- Returns:
- the player, or null if not found
-
getLocal
Gets the local player (your character).- Returns:
- the local player
-
getAll
Gets all players in the loaded scene.- Returns:
- list of all players
-
getAll
Gets all players matching a filter.- Parameters:
filter- the predicate to match- Returns:
- list of matching players
-
getAll
Gets all players with any of the specified IDs.- Parameters:
ids- the player IDs to match- Returns:
- list of matching players
-
getAll
Gets all players with any of the specified names.- Parameters:
names- the player names to match- Returns:
- list of matching players
-
getNearest
public static IPlayer getNearest(net.runelite.api.coords.WorldPoint worldPoint, Predicate<? super IPlayer> filter) Gets the nearest player to a point matching a filter.- Parameters:
worldPoint- the reference pointfilter- the predicate to match- Returns:
- the nearest matching player, or null if none found
-
getNearest
Gets the nearest player to a point with any of the specified IDs.- Parameters:
worldPoint- the reference pointids- the player IDs to match- Returns:
- the nearest matching player, or null if none found
-
getNearest
Gets the nearest player to a point with any of the specified names.- Parameters:
worldPoint- the reference pointnames- the player names to match- Returns:
- the nearest matching player, or null if none found
-
getNearest
Gets the nearest player to the local player matching a filter.- Parameters:
filter- the predicate to match- Returns:
- the nearest matching player, or null if none found
-
getNearest
Gets the nearest player to the local player with any of the specified IDs.- Parameters:
ids- the player IDs to match- Returns:
- the nearest matching player, or null if none found
-
getNearest
Gets the nearest player to the local player with any of the specified names.- Parameters:
names- the player names to match- Returns:
- the nearest matching player, or null if none found
-
getHintArrowed
Gets the player with the hint arrow pointing to them.- Returns:
- the hint arrowed player, or null if none
-