public interface Objective
scoreboard
.Modifier and Type | Method | Description |
---|---|---|
@NotNull String |
getCriteria() |
Gets the criteria this objective tracks.
|
@NotNull String |
getDisplayName() |
Gets the name displayed to players for this objective
|
@Nullable DisplaySlot |
getDisplaySlot() |
Gets the display slot this objective is displayed at.
|
@NotNull String |
getName() |
Gets the name of this Objective
|
@NotNull RenderType |
getRenderType() |
Sets manner in which this objective will be rendered.
|
@NotNull Score |
getScore(@NotNull String entry) |
Gets an entry's Score for an Objective on this Scoreboard.
|
@NotNull Score |
getScore(@NotNull OfflinePlayer player) |
Deprecated.
Scoreboards can contain entries that aren't players
|
@Nullable 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(@NotNull String displayName) |
Sets the name displayed to players for this objective.
|
void |
setDisplaySlot(@Nullable DisplaySlot slot) |
Sets this objective to display on the specified slot for the
scoreboard, removing it from any other display slot.
|
void |
setRenderType(@NotNull RenderType renderType) |
Sets manner in which this objective will be rendered.
|
void |
unregister() |
Unregisters this objective from the
scoreboard. |
@NotNull @NotNull String getName() throws IllegalStateException
IllegalStateException
- if this objective has been unregistered@NotNull @NotNull String getDisplayName() throws IllegalStateException
IllegalStateException
- if this objective has been unregisteredvoid setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException
displayName
- Display name to setIllegalStateException
- if this objective has been unregisteredIllegalArgumentException
- if displayName is nullIllegalArgumentException
- if displayName is longer than 128
characters.@NotNull @NotNull String getCriteria() throws IllegalStateException
IllegalStateException
- if this objective has been unregisteredboolean isModifiable() throws IllegalStateException
IllegalStateException
- if this objective has been unregisteredCriterias.HEALTH
@Nullable @Nullable Scoreboard getScoreboard()
unregistered
void unregister() throws IllegalStateException
scoreboard.
IllegalStateException
- if this objective has been unregisteredvoid setDisplaySlot(@Nullable @Nullable DisplaySlot slot) throws IllegalStateException
slot
- display slot to change, or null to not displayIllegalStateException
- if this objective has been unregistered@Nullable @Nullable DisplaySlot getDisplaySlot() throws IllegalStateException
IllegalStateException
- if this objective has been unregisteredvoid setRenderType(@NotNull @NotNull RenderType renderType) throws IllegalStateException
renderType
- new render typeIllegalStateException
- if this objective has been unregistered@NotNull @NotNull RenderType getRenderType() throws IllegalStateException
IllegalStateException
- if this objective has been unregistered@Deprecated @NotNull @NotNull Score getScore(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException
player
- Player for the ScoreIllegalArgumentException
- if player is nullIllegalStateException
- if this objective has been unregisteredgetScore(String)
@NotNull @NotNull Score getScore(@NotNull @NotNull String entry) throws IllegalArgumentException, IllegalStateException
entry
- Entry for the ScoreIllegalArgumentException
- if entry is nullIllegalStateException
- if this objective has been unregisteredIllegalArgumentException
- if entry is longer than 40 characters.Copyright © 2020. All rights reserved.