Package org.bukkit.scoreboard
Interface Scoreboard
public interface Scoreboard
A scoreboard
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearSlot
(@NotNull DisplaySlot slot) Clears any objective in the specified slot.getEntityTeam
(Entity entity) Gets an entity's Team on this ScoreboardGets all entries tracked by this ScoreboardgetEntryTeam
(@NotNull String entry) Gets a entries Team on this ScoreboardgetObjective
(@NotNull String name) Gets an Objective on this Scoreboard by namegetObjective
(@NotNull DisplaySlot slot) Gets the Objective currently displayed in a DisplaySlot on this ScoreboardGets all Objectives on this ScoreboardgetObjectivesByCriteria
(@NotNull String criteria) Deprecated.getObjectivesByCriteria
(@NotNull Criteria criteria) Gets all Objectives of a Criteria on the ScoreboardDeprecated.Scoreboards can contain entries that aren't playersgetPlayerTeam
(@NotNull OfflinePlayer player) Gets a player's Team on this ScoreboardGets all scores for an entry on this ScoreboardgetScores
(@NotNull OfflinePlayer player) Gets all scores for a player on this ScoreboardgetScoresFor
(Entity entity) Gets all scores for an entity on this ScoreboardGets a Team by name on this ScoreboardgetTeams()
Gets all teams on this ScoreboardregisterNewObjective
(@NotNull String name, @NotNull String criteria) Deprecated.a displayName should be explicitly specifiedDeprecated.registerNewObjective
(@NotNull String name, @NotNull String criteria, @NotNull String displayName, @NotNull RenderType renderType) Deprecated.registerNewObjective
(@NotNull String name, @NotNull String criteria, @Nullable Component displayName) registerNewObjective
(@NotNull String name, @NotNull String criteria, @Nullable Component displayName, @NotNull RenderType renderType) Deprecated.registerNewObjective
(@NotNull String name, @NotNull Criteria criteria, @NotNull String displayName, @NotNull RenderType renderType) Deprecated.registerNewObjective
(@NotNull String name, @NotNull Criteria criteria, @Nullable Component displayName) Registers an Objective on this ScoreboardregisterNewObjective
(@NotNull String name, @NotNull Criteria criteria, @Nullable Component displayName, @NotNull RenderType renderType) Registers an Objective on this ScoreboardregisterNewTeam
(@NotNull String name) Registers a Team on this Scoreboardvoid
resetScores
(@NotNull String entry) Removes all scores for an entry on this Scoreboardvoid
resetScores
(@NotNull OfflinePlayer player) Removes all scores for a player on this Scoreboardvoid
resetScoresFor
(Entity entity) Removes all scores for an entity on this Scoreboard
-
Method Details
-
registerNewObjective
@Deprecated @NotNull @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull String criteria) throws IllegalArgumentException Deprecated.a displayName should be explicitly specifiedRegisters an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the Objective- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull String criteria, @Nullable Component displayName) throws IllegalArgumentException Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull String criteria, @Nullable Component displayName, @NotNull @NotNull RenderType renderType) throws IllegalArgumentException Deprecated.Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.renderType
- Manner of rendering the Objective- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if renderType is nullIllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull Criteria criteria, @Nullable Component displayName) throws IllegalArgumentException Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull Criteria criteria, @Nullable Component displayName, @NotNull @NotNull RenderType renderType) throws IllegalArgumentException Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.renderType
- Manner of rendering the Objective- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if renderType is nullIllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull String criteria, @NotNull @NotNull String displayName) throws IllegalArgumentException Deprecated.Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull String criteria, @NotNull @NotNull String displayName, @NotNull @NotNull RenderType renderType) throws IllegalArgumentException Deprecated.Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.renderType
- Manner of rendering the Objective- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if renderType is nullIllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull Criteria criteria, @NotNull @NotNull String displayName) throws IllegalArgumentException Deprecated.Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if an objective by that name already exists
-
registerNewObjective
@NotNull @Deprecated @NotNull Objective registerNewObjective(@NotNull @NotNull String name, @NotNull @NotNull Criteria criteria, @NotNull @NotNull String displayName, @NotNull @NotNull RenderType renderType) throws IllegalArgumentException Deprecated.Registers an Objective on this Scoreboard- Parameters:
name
- Name of the Objectivecriteria
- Criteria for the ObjectivedisplayName
- Name displayed to players for the Objective.renderType
- Manner of rendering the Objective- Returns:
- The registered Objective
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if name is longer than 32767 characters.IllegalArgumentException
- if criteria is nullIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128 characters.IllegalArgumentException
- if renderType is nullIllegalArgumentException
- if an objective by that name already exists
-
getObjective
@Nullable @Nullable Objective getObjective(@NotNull @NotNull String name) throws 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:
IllegalArgumentException
- if name is null
-
getObjectivesByCriteria
@Deprecated @NotNull @NotNull Set<Objective> getObjectivesByCriteria(@NotNull @NotNull String criteria) throws IllegalArgumentException Deprecated.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:
IllegalArgumentException
- if criteria is null
-
getObjectivesByCriteria
@NotNull @NotNull Set<Objective> getObjectivesByCriteria(@NotNull @NotNull Criteria criteria) throws 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:
IllegalArgumentException
- if criteria is null
-
getObjectives
Gets all Objectives on this Scoreboard- Returns:
- An immutable set of all Objectives on this Scoreboard
-
getObjective
@Nullable @Nullable Objective getObjective(@NotNull @NotNull DisplaySlot slot) throws 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:
IllegalArgumentException
- if slot is null
-
getScores
@NotNull @NotNull Set<Score> getScores(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException 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:
IllegalArgumentException
- if player is null- See Also:
-
getScores
@NotNull @NotNull Set<Score> getScores(@NotNull @NotNull String entry) throws 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:
IllegalArgumentException
- if entry is null
-
resetScores
Removes all scores for a player on this Scoreboard- Parameters:
player
- the player to drop all current scores for- Throws:
IllegalArgumentException
- if player is null- See Also:
-
resetScores
Removes all scores for an entry on this Scoreboard- Parameters:
entry
- the entry to drop all current scores for- Throws:
IllegalArgumentException
- if entry is null
-
getPlayerTeam
@Nullable @Nullable Team getPlayerTeam(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException 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:
IllegalArgumentException
- if player is null- See Also:
-
getEntryTeam
@Nullable @Nullable Team getEntryTeam(@NotNull @NotNull String entry) throws 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:
IllegalArgumentException
- if entry is null
-
getTeam
Gets a Team by name on this Scoreboard- Parameters:
teamName
- Team name- Returns:
- the matching Team or null if no matches
- Throws:
IllegalArgumentException
- if teamName is null
-
getTeams
Gets all teams on this Scoreboard- Returns:
- an immutable set of Teams
-
registerNewTeam
@NotNull @NotNull Team registerNewTeam(@NotNull @NotNull String name) throws IllegalArgumentException Registers a Team on this Scoreboard- Parameters:
name
- Team name- Returns:
- registered Team
- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if team by that name already exists
-
getPlayers
Deprecated.Scoreboards can contain entries that aren't playersGets all players tracked by this Scoreboard- Returns:
- immutable set of all tracked players
- See Also:
-
getEntries
Gets all entries tracked by this Scoreboard- Returns:
- immutable set of all tracked entries
-
clearSlot
Clears any objective in the specified slot.- Parameters:
slot
- the slot to remove objectives- Throws:
IllegalArgumentException
- if slot is null
-
getScoresFor
Gets all scores for an entity on this Scoreboard- Parameters:
entity
- the entity whose scores are being retrieved- Returns:
- immutable set of all scores tracked for the entity
- Throws:
IllegalArgumentException
- if entity is null- See Also:
-
resetScoresFor
Removes all scores for an entity on this Scoreboard- Parameters:
entity
- the entity to drop all current scores for- Throws:
IllegalArgumentException
- if entity is null- See Also:
-
getEntityTeam
Gets an entity's Team on this Scoreboard- Parameters:
entity
- the entity to search for- Returns:
- the entity's Team or null if the entity is not on a team
- Throws:
IllegalArgumentException
- if entity is null- See Also:
-
getObjectivesByCriteria(Criteria)