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 Type Method Description java.lang.StringgetCriteria()Gets the criteria this objective tracks.java.lang.StringgetDisplayName()Gets the name displayed to players for this objectiveDisplaySlotgetDisplaySlot()Gets the display slot this objective is displayed at.java.lang.StringgetName()Gets the name of this ObjectiveScoregetScore(java.lang.String entry)Gets an entry's Score for an Objective on this Scoreboard.ScoregetScore(OfflinePlayer player)Deprecated.Scoreboards can contain entries that aren't playersScoreboardgetScoreboard()Gets the scoreboard to which this objective is attached.booleanisModifiable()Gets if the objective's scores can be modified directly by a plugin.voidsetDisplayName(java.lang.String displayName)Sets the name displayed to players for this objective.voidsetDisplaySlot(DisplaySlot slot)Sets this objective to display on the specified slot for the scoreboard, removing it from any other display slot.voidunregister()Unregisters this objective from thescoreboard.
- 
Method Details- 
getNamejava.lang.String getName() throws java.lang.IllegalStateExceptionGets the name of this Objective- Returns:
- this objective'ss name
- Throws:
- java.lang.IllegalStateException- if this objective has been unregistered
 
- 
getDisplayNamejava.lang.String getDisplayName() throws java.lang.IllegalStateExceptionGets the name displayed to players for this objective- Returns:
- this objective's display name
- Throws:
- java.lang.IllegalStateException- if this objective has been unregistered
 
- 
setDisplayNamevoid setDisplayName(java.lang.String displayName) throws java.lang.IllegalStateException, java.lang.IllegalArgumentExceptionSets the name displayed to players for this objective.- Parameters:
- displayName- Display name to set
- Throws:
- java.lang.IllegalStateException- if this objective has been unregistered
- java.lang.IllegalArgumentException- if displayName is null
- java.lang.IllegalArgumentException- if displayName is longer than 32 characters.
 
- 
getCriteriajava.lang.String getCriteria() throws java.lang.IllegalStateExceptionGets the criteria this objective tracks.- Returns:
- this objective's criteria
- Throws:
- java.lang.IllegalStateException- if this objective has been unregistered
 
- 
isModifiableboolean isModifiable() throws java.lang.IllegalStateExceptionGets if the objective's scores can be modified directly by a plugin.- Returns:
- true if scores are modifiable
- Throws:
- java.lang.IllegalStateException- if this objective has been unregistered
- See Also:
- Criterias.HEALTH
 
- 
getScoreboardScoreboard getScoreboard()Gets the scoreboard to which this objective is attached.- Returns:
- Owning scoreboard, or null if it has been unregistered
 
- 
unregistervoid unregister() throws java.lang.IllegalStateExceptionUnregisters this objective from thescoreboard.- Throws:
- java.lang.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:
- java.lang.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:
- java.lang.IllegalStateException- if this objective has been unregistered
 
- 
getScore@Deprecated Score getScore(OfflinePlayer player) throws java.lang.IllegalArgumentException, java.lang.IllegalStateExceptionDeprecated.Scoreboards can contain entries that aren't playersGets 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:
- java.lang.IllegalArgumentException- if player is null
- java.lang.IllegalStateException- if this objective has been unregistered
- See Also:
- getScore(String)
 
- 
getScoreScore getScore(java.lang.String entry) throws java.lang.IllegalArgumentException, java.lang.IllegalStateExceptionGets 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:
- java.lang.IllegalArgumentException- if entry is null
- java.lang.IllegalStateException- if this objective has been unregistered
 
 
-