Package rsb.methods

Class Players


public class Players extends MethodProvider
Player related operations.
  • Field Details

    • ALL_FILTER

      public static final Filter<RSPlayer> ALL_FILTER
      A filter that accepts all matches.
  • Method Details

    • getMyPlayer

      public RSPlayer getMyPlayer()
      Returns an RSPlayer object representing the current player.
      Returns:
      An RSPlayer object representing the player.
    • getAll

      public RSPlayer[] getAll()
      Returns an array of all valid RSPlayers.
      Returns:
      All valid RSPlayers.
    • getAll

      public RSPlayer[] getAll(Filter<RSPlayer> filter)
      Returns an array of all valid RSPlayers.
      Parameters:
      filter - Filters out unwanted matches.
      Returns:
      All valid RSPlayers.
    • getNearest

      public RSPlayer getNearest(Filter<RSPlayer> filter)
      Returns the RSPlayer that is nearest, out of all of the Players accepted by the provided filter.
      Parameters:
      filter - Filters unwanted matches.
      Returns:
      An RSPlayer object representing the nearest player that was accepted by the provided Filter; or null if there are no matching players in the current region.
    • getNearest

      public RSPlayer getNearest(String name)
      Returns the RSPlayer that is nearest, out of all of the Players with the provided name.
      Parameters:
      name - The name of the RSPlayer that you are searching for.
      Returns:
      An RSPlayer object representing the nearest player with the provided name; or null if there are no matching players in the current region.
    • getNearest

      public RSPlayer getNearest(int level)
      Returns the RSPlayer that is nearest, out of all of the Players with the provided combat level.
      Parameters:
      level - The combat level of the RSPlayer that you are searching for.
      Returns:
      An RSPlayer object representing the nearest player with the provided combat level; or null if there are no matching players in the current region.