Interface Score


public interface Score
A score entry for an entry on an objective. Changing this will not affect any other objective or scoreboard.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getEntry()
    Gets the entry being tracked by this Score
    Objective getObjective()
    Gets the Objective being tracked by this Score
    OfflinePlayer getPlayer()
    Deprecated.
    Scoreboards can contain entries that aren't players
    int getScore()
    Gets the current score
    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 Details

    • getPlayer

      @Deprecated OfflinePlayer getPlayer()
      Deprecated.
      Scoreboards can contain entries that aren't players
      Gets the OfflinePlayer being tracked by this Score
      Returns:
      this Score's tracked player
      See Also:
      getEntry()
    • getEntry

      java.lang.String getEntry()
      Gets the entry being tracked by this Score
      Returns:
      this Score's tracked entry
    • getObjective

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

      int getScore() throws java.lang.IllegalStateException
      Gets the current score
      Returns:
      the current score
      Throws:
      java.lang.IllegalStateException - if the associated objective has been unregistered
    • setScore

      void setScore​(int score) throws java.lang.IllegalStateException
      Sets the current score.
      Parameters:
      score - New score
      Throws:
      java.lang.IllegalStateException - if the associated objective has been unregistered
    • isScoreSet

      boolean isScoreSet() throws java.lang.IllegalStateException
      Shows if this score has been set at any point in time.
      Returns:
      if this score has been set before
      Throws:
      java.lang.IllegalStateException - if the associated objective has been unregistered
    • getScoreboard

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