@NonnullByDefault public interface ScoreboardObjective
Scoreboard.| Modifier and Type | Method and Description |
|---|---|
void |
applyLines(Collection<String> lines)
Automatically applies a set of score lines to this objective.
|
void |
applyLines(String... lines)
Automatically applies a set of score lines to this objective.
|
void |
applyScores(Map<String,Integer> scores)
Applies a score mapping to this objective
|
void |
clearScores()
Clears the scores from this objective
|
String |
getDisplayName()
Gets the current display name of this objective
|
DisplaySlot |
getDisplaySlot()
Gets the current display slot of this objective
|
String |
getId()
Gets the id of this objective
|
Integer |
getScore(String name)
Gets the value mapped to a given score, if present
|
Map<String,Integer> |
getScores()
Gets an immutable copy of the current objective scores
|
boolean |
hasScore(String name)
Returns true if this objective has a given score
|
boolean |
removeScore(String name)
Removes a score
|
void |
setAutoSubscribe(boolean autoSubscribe)
Sets if players should be automatically subscribed to this objective.
|
void |
setDisplayName(String displayName)
Lazily sets the display name to a new value and updates the objectives subscribers
|
void |
setDisplaySlot(DisplaySlot displaySlot)
Lazily sets the display slot to a new value and updates the objectives subscribers
|
void |
setScore(String name,
int value)
Sets a new score value
|
boolean |
shouldAutoSubscribe()
Gets if players should be automatically subscribed to this objective.
|
void |
subscribe(Player player)
Subscribes a player to this objective
|
void |
unsubscribe(Player player)
Unsubscribes a player from this objective
|
void |
unsubscribe(Player player,
boolean fast)
Unsubscribes a player from this objective
|
void |
unsubscribeAll()
Unsubscribes all players from this objective
|
String getId()
boolean shouldAutoSubscribe()
void setAutoSubscribe(boolean autoSubscribe)
autoSubscribe - if players should be automatically subscribedString getDisplayName()
void setDisplayName(String displayName)
displayName - the new display nameDisplaySlot getDisplaySlot()
void setDisplaySlot(DisplaySlot displaySlot)
displaySlot - the new display slotMap<String,Integer> getScores()
boolean hasScore(String name)
name - the name of the score to check for@Nullable Integer getScore(String name)
name - the name of the scorevoid setScore(String name, int value)
name - the name of the scorevalue - the value to set the score toboolean removeScore(String name)
name - the name of the scorevoid clearScores()
void applyScores(Map<String,Integer> scores)
scores - the scores to applyvoid applyLines(String... lines)
lines - the lines to applyvoid applyLines(Collection<String> lines)
lines - the lines to applyvoid subscribe(Player player)
player - the player to subscribevoid unsubscribe(Player player)
player - the player to unsubscribevoid unsubscribe(Player player, boolean fast)
player - the player to unsubscribefast - if true, the removal packet will not be sent (for use when the player is leaving)void unsubscribeAll()
Copyright © 2020. All rights reserved.