Package org.bukkit.scoreboard
Interface Score
-
public interface Score
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @NotNull String
getEntry()
Gets the entry being tracked by this Score@NotNull Objective
getObjective()
Gets the Objective being tracked by this Score@NotNull OfflinePlayer
getPlayer()
Deprecated.Scoreboards can contain entries that aren't playersint
getScore()
Gets the current score@Nullable Scoreboard
getScoreboard()
Gets the scoreboard for the associated objective.boolean
isScoreSet()
Shows if this score has been set at any point in time.void
setScore(int score)
Sets the current score.
-
-
-
Method Detail
-
getPlayer
@Deprecated @NotNull @NotNull OfflinePlayer getPlayer()
Deprecated.Scoreboards can contain entries that aren't playersGets the OfflinePlayer being tracked by this Score- Returns:
- this Score's tracked player
- See Also:
getEntry()
-
getEntry
@NotNull @NotNull String getEntry()
Gets the entry being tracked by this Score- Returns:
- this Score's tracked entry
-
getObjective
@NotNull @NotNull Objective getObjective()
Gets the Objective being tracked by this Score- Returns:
- this Score's tracked objective
-
getScore
int getScore() throws IllegalStateException
Gets the current score- Returns:
- the current score
- Throws:
IllegalStateException
- if the associated objective has been unregistered
-
setScore
void setScore(int score) throws IllegalStateException
Sets the current score.- Parameters:
score
- New score- Throws:
IllegalStateException
- if the associated objective has been unregistered
-
isScoreSet
boolean isScoreSet() throws IllegalStateException
Shows if this score has been set at any point in time.- Returns:
- if this score has been set before
- Throws:
IllegalStateException
- if the associated objective has been unregistered
-
getScoreboard
@Nullable @Nullable Scoreboard getScoreboard()
Gets the scoreboard for the associated objective.- Returns:
- the owning objective's scoreboard, or null if it has been
unregistered
-
-