Interface Scoreboard
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a builder to createScoreboardinstances. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObjective(Objective objective) Adds the specifiedObjectiveto this scoreboard.static Scoreboard.Builderbuilder()Creates a newScoreboard.Builderto build aScoreboard.default voidclearSlot(Supplier<? extends DisplaySlot> slot) Clears anyObjectivein the specified slot.default voidclearSlot(DisplaySlot slot) Clears anyObjectivein the specified slot.memberTeam(Component member) Gets anObjectiveon this scoreboard by name, if it exists.objective(Supplier<? extends DisplaySlot> slot) Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.objective(DisplaySlot slot) Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.Gets allObjectives on this scoreboard.objectivesByCriterion(Supplier<? extends Criterion> criterion) Gets allObjectives of a Criteria on this scoreboard.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(String name) Removes all scores with the specified name on this scoreboard, across all objectives.scores()Gets all the scores on this scoreboard, across all objectives.Gets all scores with the specified name on this scoreboard, across all objectives.Gets aTeamby name on this scoreboard.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 Details
-
builder
Creates a newScoreboard.Builderto build aScoreboard.- Returns:
- The new builder
-
objective
-
objective
Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.- Parameters:
slot- TheDisplaySlot- Returns:
- the
Objectivecurrently displayed, if present
-
objective
Gets theObjectivecurrently displayed in aDisplaySloton this scoreboard, if one is present.- Parameters:
slot- TheDisplaySlot- Returns:
- the
Objectivecurrently displayed, if present
-
addObjective
-
updateDisplaySlot
default void updateDisplaySlot(@Nullable Objective objective, DefaultedRegistryReference<? extends DisplaySlot> displaySlot) throws IllegalStateException Sets the specifiedObjectivein the specifiedDisplaySlot.If the
Objectiveisnull, then the specifiedDisplaySlotwill be cleared.- Parameters:
objective- TheObjectiveto setdisplaySlot- TheDisplaySlotto the specifiedObjectivein- Throws:
IllegalStateException- if the specifiedObjectivedoes not exist on this scoreboard
-
updateDisplaySlot
void updateDisplaySlot(@Nullable Objective objective, DisplaySlot displaySlot) throws IllegalStateException Sets the specifiedObjectivein the specifiedDisplaySlot.If the
Objectiveisnull, then the specifiedDisplaySlotwill be cleared.- Parameters:
objective- TheObjectiveto setdisplaySlot- TheDisplaySlotto the specifiedObjectivein- Throws:
IllegalStateException- if the specifiedObjectivedoes not exist on this scoreboard
-
clearSlot
Clears anyObjectivein the specified slot.- Parameters:
slot- TheDisplaySlotto remove anyObjectivefor
-
clearSlot
Clears anyObjectivein the specified slot.- Parameters:
slot- TheDisplaySlotto remove anyObjectivefor
-
objectivesByCriterion
-
objectivesByCriterion
-
objectives
-
removeObjective
-
scores
-
scores
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
-
removeScores
Removes all scores with the specified name on this scoreboard, across all objectives.- Parameters:
name- The name to remove all scores for
-
team
-
registerTeam
Registers the specifiedTeamto this scoreboard.- Parameters:
team- TheTeamto register- Throws:
IllegalArgumentException- if a team with the samenamealready exists on this scoreboard, or if the specifiedTeamis already registered to a scoreboard (this scoreboard, or another one).
-
teams
-
memberTeam
-