Interface Scoreboard


public interface Scoreboard
A scoreboard
  • Method Summary

    Modifier and Type Method Description
    void clearSlot​(DisplaySlot slot)
    Clears any objective in the specified slot.
    java.util.Set<java.lang.String> getEntries()
    Gets all entries tracked by this Scoreboard
    Team getEntryTeam​(java.lang.String entry)
    Gets a entries Team on this Scoreboard
    Objective getObjective​(java.lang.String name)
    Gets an Objective on this Scoreboard by name
    Objective getObjective​(DisplaySlot slot)
    Gets the Objective currently displayed in a DisplaySlot on this Scoreboard
    java.util.Set<Objective> getObjectives()
    Gets all Objectives on this Scoreboard
    java.util.Set<Objective> getObjectivesByCriteria​(java.lang.String criteria)
    Gets all Objectives of a Criteria on the Scoreboard
    java.util.Set<OfflinePlayer> getPlayers()
    Deprecated.
    Scoreboards can contain entries that aren't players
    Team getPlayerTeam​(OfflinePlayer player)
    Deprecated.
    Scoreboards can contain entries that aren't players
    java.util.Set<Score> getScores​(java.lang.String entry)
    Gets all scores for an entry on this Scoreboard
    java.util.Set<Score> getScores​(OfflinePlayer player)
    Deprecated.
    Scoreboards can contain entries that aren't players
    Team getTeam​(java.lang.String teamName)
    Gets a Team by name on this Scoreboard
    java.util.Set<Team> getTeams()
    Gets all teams on this Scoreboard
    Objective registerNewObjective​(java.lang.String name, java.lang.String criteria)
    Registers an Objective on this Scoreboard
    Team registerNewTeam​(java.lang.String name)
    Registers a Team on this Scoreboard
    void resetScores​(java.lang.String entry)
    Removes all scores for an entry on this Scoreboard
    void resetScores​(OfflinePlayer player)
    Deprecated.
    Scoreboards can contain entries that aren't players
  • Method Details

    • registerNewObjective

      Objective registerNewObjective​(java.lang.String name, java.lang.String criteria) throws java.lang.IllegalArgumentException
      Registers an Objective on this Scoreboard
      Parameters:
      name - Name of the Objective
      criteria - Criteria for the Objective
      Returns:
      The registered Objective
      Throws:
      java.lang.IllegalArgumentException - if name is null
      java.lang.IllegalArgumentException - if criteria is null
      java.lang.IllegalArgumentException - if an objective by that name already exists
    • getObjective

      Objective getObjective​(java.lang.String name) throws java.lang.IllegalArgumentException
      Gets an Objective on this Scoreboard by name
      Parameters:
      name - Name of the Objective
      Returns:
      the Objective or null if it does not exist
      Throws:
      java.lang.IllegalArgumentException - if name is null
    • getObjectivesByCriteria

      java.util.Set<Objective> getObjectivesByCriteria​(java.lang.String criteria) throws java.lang.IllegalArgumentException
      Gets all Objectives of a Criteria on the Scoreboard
      Parameters:
      criteria - Criteria to search by
      Returns:
      an immutable set of Objectives using the specified Criteria
      Throws:
      java.lang.IllegalArgumentException
    • getObjectives

      java.util.Set<Objective> getObjectives()
      Gets all Objectives on this Scoreboard
      Returns:
      An immutable set of all Objectives on this Scoreboard
    • getObjective

      Objective getObjective​(DisplaySlot slot) throws java.lang.IllegalArgumentException
      Gets the Objective currently displayed in a DisplaySlot on this Scoreboard
      Parameters:
      slot - The DisplaySlot
      Returns:
      the Objective currently displayed or null if nothing is displayed in that DisplaySlot
      Throws:
      java.lang.IllegalArgumentException - if slot is null
    • getScores

      @Deprecated java.util.Set<Score> getScores​(OfflinePlayer player) throws java.lang.IllegalArgumentException
      Deprecated.
      Scoreboards can contain entries that aren't players
      Gets all scores for a player on this Scoreboard
      Parameters:
      player - the player whose scores are being retrieved
      Returns:
      immutable set of all scores tracked for the player
      Throws:
      java.lang.IllegalArgumentException - if player is null
      See Also:
      getScores(String)
    • getScores

      java.util.Set<Score> getScores​(java.lang.String entry) throws java.lang.IllegalArgumentException
      Gets all scores for an entry on this Scoreboard
      Parameters:
      entry - the entry whose scores are being retrieved
      Returns:
      immutable set of all scores tracked for the entry
      Throws:
      java.lang.IllegalArgumentException - if entry is null
    • resetScores

      @Deprecated void resetScores​(OfflinePlayer player) throws java.lang.IllegalArgumentException
      Deprecated.
      Scoreboards can contain entries that aren't players
      Removes all scores for a player on this Scoreboard
      Parameters:
      player - the player to drop all current scores for
      Throws:
      java.lang.IllegalArgumentException - if player is null
      See Also:
      resetScores(String)
    • resetScores

      void resetScores​(java.lang.String entry) throws java.lang.IllegalArgumentException
      Removes all scores for an entry on this Scoreboard
      Parameters:
      entry - the entry to drop all current scores for
      Throws:
      java.lang.IllegalArgumentException - if entry is null
    • getPlayerTeam

      @Deprecated Team getPlayerTeam​(OfflinePlayer player) throws java.lang.IllegalArgumentException
      Deprecated.
      Scoreboards can contain entries that aren't players
      Gets a player's Team on this Scoreboard
      Parameters:
      player - the player to search for
      Returns:
      the player's Team or null if the player is not on a team
      Throws:
      java.lang.IllegalArgumentException - if player is null
      See Also:
      getEntryTeam(String)
    • getEntryTeam

      Team getEntryTeam​(java.lang.String entry) throws java.lang.IllegalArgumentException
      Gets a entries Team on this Scoreboard
      Parameters:
      entry - the entry to search for
      Returns:
      the entries Team or null if the entry is not on a team
      Throws:
      java.lang.IllegalArgumentException - if entry is null
    • getTeam

      Team getTeam​(java.lang.String teamName) throws java.lang.IllegalArgumentException
      Gets a Team by name on this Scoreboard
      Parameters:
      teamName - Team name
      Returns:
      the matching Team or null if no matches
      Throws:
      java.lang.IllegalArgumentException - if teamName is null
    • getTeams

      java.util.Set<Team> getTeams()
      Gets all teams on this Scoreboard
      Returns:
      an immutable set of Teams
    • registerNewTeam

      Team registerNewTeam​(java.lang.String name) throws java.lang.IllegalArgumentException
      Registers a Team on this Scoreboard
      Parameters:
      name - Team name
      Returns:
      registered Team
      Throws:
      java.lang.IllegalArgumentException - if name is null
      java.lang.IllegalArgumentException - if team by that name already exists
    • getPlayers

      @Deprecated java.util.Set<OfflinePlayer> getPlayers()
      Deprecated.
      Scoreboards can contain entries that aren't players
      Gets all players tracked by this Scoreboard
      Returns:
      immutable set of all tracked players
      See Also:
      getEntries()
    • getEntries

      java.util.Set<java.lang.String> getEntries()
      Gets all entries tracked by this Scoreboard
      Returns:
      immutable set of all tracked entries
    • clearSlot

      void clearSlot​(DisplaySlot slot) throws java.lang.IllegalArgumentException
      Clears any objective in the specified slot.
      Parameters:
      slot - the slot to remove objectives
      Throws:
      java.lang.IllegalArgumentException - if slot is null