public interface Objective
Entries can be updated by plugins, by in-game commands, or automatically by the game, depending
on their Criterion
.
Modifier and Type | Method and Description |
---|---|
void |
addScore(Score score)
Adds the specified
Score to this objective. |
Criterion |
getCriterion()
Gets the criterion for this objective.
|
ObjectiveDisplayMode |
getDisplayMode()
Gets the
ObjectiveDisplayMode used to display this objective. |
Text |
getDisplayName()
Gets the name displayed to players.
|
String |
getName()
Gets the name of this Objective.
|
Score |
getScore(Text name)
Gets an entry's
Score for this Objective. |
Set<Scoreboard> |
getScoreboards()
|
Map<Text,Score> |
getScores()
Gets the set of
Score s for this objective. |
void |
removeScore(Score score)
Removes the specified
Score to this objective. |
void |
setDisplayMode(ObjectiveDisplayMode displayMode)
Sets the
ObjectiveDisplayMode used to display this objective. |
void |
setDisplayName(Text displayName)
Sets the name displayed to players.
|
String getName()
Text getDisplayName()
void setDisplayName(Text displayName) throws IllegalArgumentException
displayName
- Display name to setIllegalArgumentException
- if displayName is longer than 32
charactersCriterion getCriterion()
ObjectiveDisplayMode getDisplayMode()
ObjectiveDisplayMode
used to display this objective.ObjectiveDisplayMode
used to display this objectivevoid setDisplayMode(ObjectiveDisplayMode displayMode)
ObjectiveDisplayMode
used to display this objective.displayMode
- The ObjectiveDisplayMode
used to display this objectiveMap<Text,Score> getScores()
Score
s for this objective.Score
s for this objectivevoid addScore(Score score) throws IllegalArgumentException
Score
to this objective.score
- The Score
to addIllegalArgumentException
- If a Score
with the same name exists, or the specified Score
has already been addedvoid removeScore(Score score)
Score
to this objective.score
- The Score
to removeSet<Scoreboard> getScoreboards()
Set
of parent Scoreboard
s this
Objective
is registered to