Class TeamManager

java.lang.Object
net.minestom.server.scoreboard.TeamManager

public final class TeamManager extends Object
An object which manages all the Team's
  • Constructor Details

    • TeamManager

      public TeamManager()
      Default constructor
  • Method Details

    • registerNewTeam

      protected void registerNewTeam(@NotNull @NotNull Team team)
      Registers a new Team
      Parameters:
      team - The team to be registered
    • deleteTeam

      public boolean deleteTeam(@NotNull @NotNull String registryName)
      Deletes a Team
      Parameters:
      registryName - The registry name of team
      Returns:
      true if the team was deleted, otherwise false
    • deleteTeam

      public boolean deleteTeam(@NotNull @NotNull Team team)
      Deletes a Team
      Parameters:
      team - The team to be deleted
      Returns:
      true if the team was deleted, otherwise false
    • createBuilder

      public TeamBuilder createBuilder(@NotNull @NotNull String name)
      Initializes a new TeamBuilder for creating a team
      Parameters:
      name - The registry name of the team
      Returns:
      the team builder
    • createTeam

      public Team createTeam(@NotNull @NotNull String name)
      Creates a Team with only the registry name
      Parameters:
      name - The registry name
      Returns:
      the created Team
    • createTeam

      public Team createTeam(String name, Component prefix, NamedTextColor teamColor, Component suffix)
      Creates a Team with the registry name, prefix, suffix and the team format
      Parameters:
      name - The registry name
      prefix - The team prefix
      teamColor - The team format
      suffix - The team suffix
      Returns:
      the created Team with a prefix, teamColor and suffix
    • createTeam

      public Team createTeam(String name, Component displayName, Component prefix, NamedTextColor teamColor, Component suffix)
      Creates a Team with the registry name, display name, prefix, suffix and the team colro
      Parameters:
      name - The registry name
      displayName - The display name
      prefix - The team prefix
      teamColor - The team color
      suffix - The team suffix
      Returns:
      the created Team with a prefix, teamColor, suffix and the display name
    • getTeam

      public Team getTeam(String teamName)
      Gets a Team with the given name
      Parameters:
      teamName - The registry name of the team
      Returns:
      a registered Team or null
    • exists

      public boolean exists(String teamName)
      Checks if the given name a registry name of a registered Team
      Parameters:
      teamName - The name of the team
      Returns:
      true if the team is registered, otherwise false
    • exists

      public boolean exists(Team team)
      Checks if the given Team registered
      Parameters:
      team - The searched team
      Returns:
      true if the team is registered, otherwise false
    • getPlayers

      public List<String> getPlayers(Team team)
      Gets a List with all registered Player in the team
      Note: The list exclude all entities. To get all entities of the team, you can use getEntities(Team)
      Parameters:
      team - The team
      Returns:
      a List with all registered Player
    • getEntities

      public List<String> getEntities(Team team)
      Gets a List with all registered LivingEntity in the team
      Note: The list exclude all players. To get all players of the team, you can use getPlayers(Team)
      Parameters:
      team - The team
      Returns:
      a List with all registered LivingEntity
    • getTeams

      public Set<Team> getTeams()
      Gets a Set with all registered Team's
      Returns:
      a Set with all registered Team's