org.bukkit.scoreboard
Interface Objective


public interface Objective

An objective on a scoreboard that can show scores specific to players. This objective is only relevant to the display of the associated scoreboard.


Method Summary
 String getCriteria()
          Gets the criteria this objective tracks.
 String getDisplayName()
          Gets the name displayed to players for this objective
 DisplaySlot getDisplaySlot()
          Gets the display slot this objective is displayed at.
 String getName()
          Gets the name of this Objective
 Score getScore(OfflinePlayer player)
          Gets a player's Score for an Objective on this Scoreboard
 Scoreboard getScoreboard()
          Gets the scoreboard to which this objective is attached.
 boolean isModifiable()
          Gets if the objective's scores can be modified directly by a plugin.
 void setDisplayName(String displayName)
          Sets the name displayed to players for this objective.
 void setDisplaySlot(DisplaySlot slot)
          Sets this objective to display on the specified slot for the scoreboard, removing it from any other display slot.
 void unregister()
          Unregisters this objective from the scoreboard.
 

Method Detail

getName

String getName()
               throws IllegalStateException
Gets the name of this Objective

Returns:
this objective'ss name
Throws:
IllegalStateException - if this objective has been unregistered

getDisplayName

String getDisplayName()
                      throws IllegalStateException
Gets the name displayed to players for this objective

Returns:
this objective's display name
Throws:
IllegalStateException - if this objective has been unregistered

setDisplayName

void setDisplayName(String 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 32 characters.

getCriteria

String getCriteria()
                   throws IllegalStateException
Gets the criteria this objective tracks.

Returns:
this objective's criteria
Throws:
IllegalStateException - if this objective has been unregistered

isModifiable

boolean isModifiable()
                     throws IllegalStateException
Gets 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:
Criterias.HEALTH

getScoreboard

Scoreboard getScoreboard()
Gets the scoreboard to which this objective is attached.

Returns:
Owning scoreboard, or null if it has been unregistered

unregister

void unregister()
                throws IllegalStateException
Unregisters this objective from the scoreboard.

Throws:
IllegalStateException - if this objective has been unregistered

setDisplaySlot

void setDisplaySlot(DisplaySlot slot)
                    throws IllegalStateException
Sets 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

getDisplaySlot

DisplaySlot getDisplaySlot()
                           throws IllegalStateException
Gets 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

getScore

Score getScore(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


Copyright © 2013. All Rights Reserved.