Package org.bukkit.scoreboard
Interface Objective
public interface Objective
An objective on a scoreboard that can show scores specific to entries. This
 objective is only relevant to the display of the associated 
scoreboard.- 
Method SummaryModifier and TypeMethodDescriptionGets the name displayed to players for this objectivevoiddisplayName(@Nullable Component displayName) Sets the name displayed to players for this objective.Deprecated.Deprecated.in favour ofdisplayName()Gets the display slot this objective is displayed at.getName()Gets the name of this ObjectiveSets manner in which this objective will be rendered.Gets an entry's Score for an Objective on this Scoreboard.getScore(@NotNull OfflinePlayer player) Gets a player's Score for an Objective on this ScoreboardGets the scoreboard to which this objective is attached.getScoreFor(Entity entity) Gets an entity's Score for an Objective on this Scoreboard.Gets the criteria this objective tracks.booleanGets if the objective's scores can be modified directly by a plugin.voidsetDisplayName(@NotNull String displayName) Deprecated.in favour ofdisplayName(net.kyori.adventure.text.Component)voidSets this objective to display on the specified slot for the scoreboard, removing it from any other display slot.voidsetRenderType(@NotNull RenderType renderType) Sets manner in which this objective will be rendered.voidUnregisters this objective from thescoreboard.
- 
Method Details- 
getNameGets the name of this Objective- Returns:
- this objective's name
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
displayNameGets the name displayed to players for this objective- Returns:
- this objective's display name
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
displayNamevoid displayName(@Nullable Component displayName) throws IllegalStateException, IllegalArgumentException Sets the name displayed to players for this objective.- Parameters:
- displayName- Display name to set
- Throws:
- IllegalStateException- if this objective has been unregistered
- IllegalArgumentException- if displayName is null
- IllegalArgumentException- if displayName is longer than 128 characters.
 
- 
getDisplayNameDeprecated.in favour ofdisplayName()Gets the name displayed to players for this objective- Returns:
- this objective's display name
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
setDisplayName@Deprecated void setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException Deprecated.in favour ofdisplayName(net.kyori.adventure.text.Component)Sets the name displayed to players for this objective.- Parameters:
- displayName- Display name to set
- Throws:
- IllegalStateException- if this objective has been unregistered
- IllegalArgumentException- if displayName is null
- IllegalArgumentException- if displayName is longer than 128 characters.
 
- 
getCriteriaDeprecated.Gets the criteria this objective tracks.- Returns:
- this objective's criteria
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
getTrackedCriteriaGets the criteria this objective tracks.- Returns:
- this objective's criteria
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
isModifiableGets if the objective's scores can be modified directly by a plugin.- Returns:
- true if scores are modifiable
- Throws:
- IllegalStateException- if this objective has been unregistered
- See Also:
 
- 
getScoreboardGets the scoreboard to which this objective is attached.- Returns:
- Owning scoreboard, or null if it has been unregistered
 
- 
unregisterUnregisters this objective from thescoreboard.- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
setDisplaySlotSets this objective to display on the specified slot for the scoreboard, removing it from any other display slot.- Parameters:
- slot- display slot to change, or null to not display
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
getDisplaySlotGets the display slot this objective is displayed at.- Returns:
- the display slot for this objective, or null if not displayed
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
setRenderTypeSets manner in which this objective will be rendered.- Parameters:
- renderType- new render type
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
getRenderTypeSets manner in which this objective will be rendered.- Returns:
- the render type
- Throws:
- IllegalStateException- if this objective has been unregistered
 
- 
getScore@NotNull @NotNull Score getScore(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException Gets a player's Score for an Objective on this Scoreboard- Parameters:
- player- Player for the Score
- Returns:
- Score tracking the Objective and player specified
- Throws:
- IllegalArgumentException- if player is null
- IllegalStateException- if this objective has been unregistered
- See Also:
 
- 
getScore@NotNull @NotNull Score getScore(@NotNull @NotNull String entry) throws IllegalArgumentException, IllegalStateException Gets an entry's Score for an Objective on this Scoreboard.- Parameters:
- entry- Entry for the Score
- Returns:
- Score tracking the Objective and entry specified
- Throws:
- IllegalArgumentException- if entry is null
- IllegalStateException- if this objective has been unregistered
- IllegalArgumentException- if entry is longer than 32767 characters.
 
- 
getScoreFor@NotNull @NotNull Score getScoreFor(@NotNull Entity entity) throws IllegalArgumentException, IllegalStateException Gets an entity's Score for an Objective on this Scoreboard.- Parameters:
- entity- Entity for the Score
- Returns:
- Score tracking the Objective and entity specified
- Throws:
- IllegalArgumentException- if entity is null
- IllegalStateException- if this objective has been unregistered
 
 
- 
getTrackedCriteria()