接口 Score


public interface Score
A score entry for an entry on an objective. Changing this will not affect any other objective or scoreboard.
  • 方法概要

    修饰符和类型
    方法
    说明
    Gets the entry being tracked by this Score
    Gets the Objective being tracked by this Score
    已过时。
    Scoreboards can contain entries that aren't players
    int
    Gets the current score
    Gets the scoreboard for the associated objective.
    boolean
    Shows if this score has been set at any point in time.
    void
    setScore(int score)
    Sets the current score.
  • 方法详细资料

    • getPlayer

      已过时。
      Scoreboards can contain entries that aren't players
      Gets the OfflinePlayer being tracked by this Score
      返回:
      this Score's tracked player
      另请参阅:
    • getEntry

      String getEntry()
      Gets the entry being tracked by this Score
      返回:
      this Score's tracked entry
    • getObjective

      Objective getObjective()
      Gets the Objective being tracked by this Score
      返回:
      this Score's tracked objective
    • getScore

      int getScore() throws IllegalStateException
      Gets the current score
      返回:
      the current score
      抛出:
      IllegalStateException - if the associated objective has been unregistered
    • setScore

      void setScore(int score) throws IllegalStateException
      Sets the current score.
      参数:
      score - New score
      抛出:
      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.
      返回:
      if this score has been set before
      抛出:
      IllegalStateException - if the associated objective has been unregistered
    • getScoreboard

      Scoreboard getScoreboard()
      Gets the scoreboard for the associated objective.
      返回:
      the owning objective's scoreboard, or null if it has been unregistered