Interface Scoreboard

    • Method Detail

      • objective

        java.util.Optional<Objective> objective​(java.lang.String name)
        Gets an Objective on this scoreboard by name, if it exists.
        Parameters:
        name - Name of the Objective
        Returns:
        The Objective, if it exists
      • objective

        default java.util.Optional<Objective> objective​(java.util.function.Supplier<? extends DisplaySlot> slot)
        Gets the Objective currently displayed in a DisplaySlot on this scoreboard, if one is present.
        Parameters:
        slot - The DisplaySlot
        Returns:
        the Objective currently displayed, if present
      • addObjective

        void addObjective​(Objective objective)
                   throws java.lang.IllegalArgumentException
        Adds the specified Objective to this scoreboard.
        Parameters:
        objective - The Objective add
        Throws:
        java.lang.IllegalArgumentException - if an Objective with the same name already exists, or if the specified Objective has already been added.
      • clearSlot

        default void clearSlot​(java.util.function.Supplier<? extends DisplaySlot> slot)
        Clears any Objective in the specified slot.
        Parameters:
        slot - The DisplaySlot to remove any Objective for
      • objectivesByCriterion

        default java.util.Set<Objective> objectivesByCriterion​(java.util.function.Supplier<? extends Criterion> criterion)
        Gets all Objectives of a Criteria on this scoreboard.
        Parameters:
        criterion - Criterion to search by
        Returns:
        A set of Objectives using the specified criterion
      • objectivesByCriterion

        java.util.Set<Objective> objectivesByCriterion​(Criterion criterion)
        Gets all Objectives of a Criteria on this scoreboard.
        Parameters:
        criterion - Criterion to search by
        Returns:
        A set of Objectives using the specified criterion
      • objectives

        java.util.Set<Objective> objectives()
        Gets all Objectives on this scoreboard.
        Returns:
        A set of all Objectives on this scoreboard
      • removeObjective

        void removeObjective​(Objective objective)
        Removes the specified Objective from this scoreboard.
        Parameters:
        objective - The Objective to remove
      • scores

        java.util.Set<Score> scores()
        Gets all the scores on this scoreboard, across all objectives.

        If the same Score has been added to multiple objectives, it will only appear once in the set.

        Returns:
        A set of all scores
      • scores

        java.util.Set<Score> scores​(Component name)
        Gets all scores with the specified name on this scoreboard, across all objectives.

        If the same Score has been added to multiple objectives, it will only appear once in the set.

        Parameters:
        name - The name whose scores are being retrieved
        Returns:
        A set of all scores for the name
      • removeScores

        void removeScores​(Component name)
        Removes all scores with the specified name on this scoreboard, across all objectives.
        Parameters:
        name - The name to remove all scores for
      • team

        java.util.Optional<Team> team​(java.lang.String teamName)
        Gets a Team by name on this scoreboard.
        Parameters:
        teamName - The name of the Team
        Returns:
        The matching Team, if it exists
      • registerTeam

        void registerTeam​(Team team)
                   throws java.lang.IllegalArgumentException
        Registers the specified Team to this scoreboard.
        Parameters:
        team - The Team to register
        Throws:
        java.lang.IllegalArgumentException - if a team with the same name already exists on this scoreboard, or if the specified Team is already registered to a scoreboard (this scoreboard, or another one).
      • teams

        java.util.Set<Team> teams()
        Gets all the Teams on this scoreboard.
        Returns:
        The set of Teams
      • memberTeam

        java.util.Optional<Team> memberTeam​(Component member)
        Gets a Component member's Team on this scoreboard.
        Parameters:
        member - The Component to search for
        Returns:
        The Component member's Team, or Optional.empty() if the member has no team