Class Players

java.lang.Object
net.storm.sdk.entities.Players

public class Players extends Object
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 Details

    • Players

      public Players()
  • Method Details

    • query

      public static PlayerQuery query()
      Creates a new player query for fluent filtering.
      Returns:
      a new player query
    • query

      public static PlayerQuery query(Supplier<List<IPlayer>> supplier)
      Creates a new player query with a custom supplier.
      Parameters:
      supplier - the player supplier
      Returns:
      a new player query
    • get

      public static IPlayer get(int index)
      Gets a player by index in the player array.
      Parameters:
      index - the player index
      Returns:
      the player, or null if not found
    • getLocal

      public static IPlayer getLocal()
      Gets the local player (your character).
      Returns:
      the local player
    • getAll

      public static List<IPlayer> getAll()
      Gets all players in the loaded scene.
      Returns:
      list of all players
    • getAll

      public static List<IPlayer> getAll(Predicate<? super IPlayer> filter)
      Gets all players matching a filter.
      Parameters:
      filter - the predicate to match
      Returns:
      list of matching players
    • getAll

      public static List<IPlayer> getAll(int... ids)
      Gets all players with any of the specified IDs.
      Parameters:
      ids - the player IDs to match
      Returns:
      list of matching players
    • getAll

      public static List<IPlayer> getAll(String... names)
      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 point
      filter - the predicate to match
      Returns:
      the nearest matching player, or null if none found
    • getNearest

      public static IPlayer getNearest(net.runelite.api.coords.WorldPoint worldPoint, int... ids)
      Gets the nearest player to a point with any of the specified IDs.
      Parameters:
      worldPoint - the reference point
      ids - the player IDs to match
      Returns:
      the nearest matching player, or null if none found
    • getNearest

      public static IPlayer getNearest(net.runelite.api.coords.WorldPoint worldPoint, String... names)
      Gets the nearest player to a point with any of the specified names.
      Parameters:
      worldPoint - the reference point
      names - the player names to match
      Returns:
      the nearest matching player, or null if none found
    • getNearest

      public static IPlayer getNearest(Predicate<? super IPlayer> filter)
      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

      public static IPlayer getNearest(int... ids)
      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

      public static IPlayer getNearest(String... names)
      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

      public static IPlayer getHintArrowed()
      Gets the player with the hint arrow pointing to them.
      Returns:
      the hint arrowed player, or null if none