接口 Score


public interface Score
计分项跟踪的某条项目的单条分数记录. 改变此分数记录不会影响其它的计分项或计分板.
  • 方法详细资料

    • getPlayer

      已过时。
      计分板可包含非玩家项目
      获取此分数为哪个玩家而记.

      原文:Gets the OfflinePlayer being tracked by this Score

      返回:
      分数对应的玩家
      另请参阅:
    • getEntry

      获取此分数为哪个项目而记.

      原文:Gets the entry being tracked by this Score

      返回:
      分数对应的项目
    • getObjective

      @NotNull @NotNull Objective getObjective()
      获取此分数记录所属的计分项.

      原文:Gets the Objective being tracked by this Score

      返回:
      所属计分项
    • getScore

      int getScore() throws IllegalStateException
      获取当前分数.

      原文:Gets the current score

      返回:
      分数
      抛出:
      IllegalStateException - 若相关的计分项已被注销
    • setScore

      void setScore(int score) throws IllegalStateException
      设置当前分数.

      原文:Sets the current score.

      参数:
      score - 分数
      抛出:
      IllegalStateException - 若相关的计分项已被注销
    • isScoreSet

      boolean isScoreSet() throws IllegalStateException
      判断是否曾设置过分数数据.

      原文:Shows if this score has been set at any point in time.

      返回:
      是否曾设置过分数数据
      抛出:
      IllegalStateException - 若相关的计分项已被注销
    • getScoreboard

      @Nullable @Nullable Scoreboard getScoreboard()
      获取相关计分项所属的计分板.

      原文:Gets the scoreboard for the associated objective.

      返回:
      相关计分项所属的计分板, 如果计分项已被注销则为 null