Package org.spongepowered.api.scoreboard
Interface Scoreboard
- 
 public interface ScoreboardRepresents a scoreboard, which containsTeams andObjectives. The server has a default scoreboard, but eachPlayercan have their own scoreboard.- See Also:
- Scoreboards on the Minecraft Wiki
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceScoreboard.BuilderRepresents a builder to createScoreboardinstances.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddObjective(Objective objective)Adds the specifiedObjectiveto this scoreboard.static Scoreboard.Builderbuilder()Creates a newScoreboard.Builderto build aScoreboard.default voidclearSlot(java.util.function.Supplier<? extends DisplaySlot> slot)Clears anyObjectivein the specified slot.default voidclearSlot(DisplaySlot slot)Clears anyObjectivein the specified slot.java.util.Optional<Team>memberTeam(Component member)java.util.Optional<Objective>objective(java.lang.String name)Gets anObjectiveon this scoreboard by name, if it exists.default java.util.Optional<Objective>objective(java.util.function.Supplier<? extends DisplaySlot> slot)Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.java.util.Optional<Objective>objective(DisplaySlot slot)Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.java.util.Set<Objective>objectives()Gets allObjectives on this scoreboard.default java.util.Set<Objective>objectivesByCriterion(java.util.function.Supplier<? extends Criterion> criterion)Gets allObjectives of a Criteria on this scoreboard.java.util.Set<Objective>objectivesByCriterion(Criterion criterion)Gets allObjectives of a Criteria on this scoreboard.voidregisterTeam(Team team)Registers the specifiedTeamto this scoreboard.voidremoveObjective(Objective objective)Removes the specifiedObjectivefrom this scoreboard.voidremoveScores(Component name)Removes all scores with the specified name on this scoreboard, across all objectives.java.util.Set<Score>scores()Gets all the scores on this scoreboard, across all objectives.java.util.Set<Score>scores(Component name)Gets all scores with the specified name on this scoreboard, across all objectives.java.util.Optional<Team>team(java.lang.String teamName)Gets aTeamby name on this scoreboard.java.util.Set<Team>teams()Gets all theTeams on this scoreboard.default voidupdateDisplaySlot(@Nullable Objective objective, DefaultedRegistryReference<? extends DisplaySlot> displaySlot)Sets the specifiedObjectivein the specifiedDisplaySlot.voidupdateDisplaySlot(@Nullable Objective objective, DisplaySlot displaySlot)Sets the specifiedObjectivein the specifiedDisplaySlot.
 
- 
- 
- 
Method Detail- 
builderstatic Scoreboard.Builder builder() Creates a newScoreboard.Builderto build aScoreboard.- Returns:
- The new builder
 
 - 
objectivejava.util.Optional<Objective> objective(java.lang.String name) Gets anObjectiveon this scoreboard by name, if it exists.
 - 
objectivedefault java.util.Optional<Objective> objective(java.util.function.Supplier<? extends DisplaySlot> slot) Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.- Parameters:
- slot- The- DisplaySlot
- Returns:
- the Objectivecurrently displayed, if present
 
 - 
objectivejava.util.Optional<Objective> objective(DisplaySlot slot) Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.- Parameters:
- slot- The- DisplaySlot
- Returns:
- the Objectivecurrently displayed, if present
 
 - 
addObjectivevoid addObjective(Objective objective) throws java.lang.IllegalArgumentException Adds the specifiedObjectiveto this scoreboard.
 - 
updateDisplaySlotdefault void updateDisplaySlot(@Nullable Objective objective, DefaultedRegistryReference<? extends DisplaySlot> displaySlot) throws java.lang.IllegalStateException Sets the specifiedObjectivein the specifiedDisplaySlot.If the Objectiveisnull, then the specifiedDisplaySlotwill be cleared.- Parameters:
- objective- The- Objectiveto set
- displaySlot- The- DisplaySlotto the specified- Objectivein
- Throws:
- java.lang.IllegalStateException- if the specified- Objectivedoes not exist on this scoreboard
 
 - 
updateDisplaySlotvoid updateDisplaySlot(@Nullable Objective objective, DisplaySlot displaySlot) throws java.lang.IllegalStateException Sets the specifiedObjectivein the specifiedDisplaySlot.If the Objectiveisnull, then the specifiedDisplaySlotwill be cleared.- Parameters:
- objective- The- Objectiveto set
- displaySlot- The- DisplaySlotto the specified- Objectivein
- Throws:
- java.lang.IllegalStateException- if the specified- Objectivedoes not exist on this scoreboard
 
 - 
clearSlotdefault void clearSlot(java.util.function.Supplier<? extends DisplaySlot> slot) Clears anyObjectivein the specified slot.- Parameters:
- slot- The- DisplaySlotto remove any- Objectivefor
 
 - 
clearSlotdefault void clearSlot(DisplaySlot slot) Clears anyObjectivein the specified slot.- Parameters:
- slot- The- DisplaySlotto remove any- Objectivefor
 
 - 
objectivesByCriteriondefault java.util.Set<Objective> objectivesByCriterion(java.util.function.Supplier<? extends Criterion> criterion) Gets allObjectives of a Criteria on this scoreboard.
 - 
objectivesByCriterionjava.util.Set<Objective> objectivesByCriterion(Criterion criterion) Gets allObjectives of a Criteria on this scoreboard.
 - 
objectivesjava.util.Set<Objective> objectives() Gets allObjectives on this scoreboard.- Returns:
- A set of all Objectives on this scoreboard
 
 - 
removeObjectivevoid removeObjective(Objective objective) Removes the specifiedObjectivefrom this scoreboard.- Parameters:
- objective- The- Objectiveto remove
 
 - 
scoresjava.util.Set<Score> scores() Gets all the scores on this scoreboard, across all objectives.If the same Scorehas been added to multiple objectives, it will only appear once in the set.- Returns:
- A set of all scores
 
 - 
scoresjava.util.Set<Score> scores(Component name) Gets all scores with the specified name on this scoreboard, across all objectives.If the same Scorehas been added to multiple objectives, it will only appear once in the set.- Parameters:
- name- The name whose scores are being retrieved
- Returns:
- A set of all scores for the name
 
 - 
removeScoresvoid removeScores(Component name) Removes all scores with the specified name on this scoreboard, across all objectives.- Parameters:
- name- The name to remove all scores for
 
 - 
teamjava.util.Optional<Team> team(java.lang.String teamName) Gets aTeamby name on this scoreboard.
 - 
registerTeamvoid registerTeam(Team team) throws java.lang.IllegalArgumentException Registers the specifiedTeamto this scoreboard.
 
- 
 
-