Package net.minestom.server.scoreboard
Class TeamManager
java.lang.Object
net.minestom.server.scoreboard.TeamManager
public final class TeamManager
extends java.lang.Object
An object which manages all the
Team
's-
Constructor Summary
Constructors Constructor Description TeamManager()
Default constructor -
Method Summary
Modifier and Type Method Description TeamBuilder
createBuilder(java.lang.String name)
Initializes a newTeamBuilder
for creating a teamTeam
createTeam(java.lang.String name)
Creates aTeam
with only the registry nameTeam
createTeam(java.lang.String name, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
Creates aTeam
with the registry name, prefix, suffix and the team colorTeam
createTeam(java.lang.String name, ColoredText displayName, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
Creates aTeam
with the registry name, display name, prefix, suffix and the team colroboolean
deleteTeam(java.lang.String registryName)
Deletes aTeam
boolean
deleteTeam(Team team)
Deletes aTeam
boolean
exists(java.lang.String teamName)
Checks if the given name a registry name of a registeredTeam
boolean
exists(Team team)
Checks if the givenTeam
registeredjava.util.List<java.lang.String>
getEntities(Team team)
java.util.List<java.lang.String>
getPlayers(Team team)
Team
getTeam(java.lang.String teamName)
Gets aTeam
with the given namejava.util.Set<Team>
getTeams()
Gets aSet
with all registeredTeam
'sprotected void
registerNewTeam(Team team)
Registers a newTeam
-
Constructor Details
-
TeamManager
public TeamManager()Default constructor
-
-
Method Details
-
registerNewTeam
Registers a newTeam
- Parameters:
team
- The team to be registered
-
deleteTeam
public boolean deleteTeam(@NotNull java.lang.String registryName)Deletes aTeam
- Parameters:
registryName
- The registry name of team- Returns:
true
if the team was deleted, otherwisefalse
-
deleteTeam
Deletes aTeam
- Parameters:
team
- The team to be deleted- Returns:
true
if the team was deleted, otherwisefalse
-
createBuilder
Initializes a newTeamBuilder
for creating a team- Parameters:
name
- The registry name of the team- Returns:
- the team builder
-
createTeam
Creates aTeam
with only the registry name- Parameters:
name
- The registry name- Returns:
- the created
Team
-
createTeam
public Team createTeam(java.lang.String name, ColoredText prefix, ChatColor teamColor, ColoredText suffix)Creates aTeam
with the registry name, prefix, suffix and the team color- Parameters:
name
- The registry nameprefix
- The team prefixteamColor
- The team colorsuffix
- The team suffix- Returns:
- the created
Team
with a prefix, teamColor and suffix
-
createTeam
public Team createTeam(java.lang.String name, ColoredText displayName, ColoredText prefix, ChatColor teamColor, ColoredText suffix)Creates aTeam
with the registry name, display name, prefix, suffix and the team colro- Parameters:
name
- The registry namedisplayName
- The display nameprefix
- The team prefixteamColor
- The team colorsuffix
- The team suffix- Returns:
- the created
Team
with a prefix, teamColor, suffix and the display name
-
getTeam
Gets aTeam
with the given name- Parameters:
teamName
- The registry name of the team- Returns:
- a registered
Team
ornull
-
exists
public boolean exists(java.lang.String teamName)Checks if the given name a registry name of a registeredTeam
- Parameters:
teamName
- The name of the team- Returns:
true
if the team is registered, otherwisefalse
-
exists
Checks if the givenTeam
registered- Parameters:
team
- The searched team- Returns:
true
if the team is registered, otherwisefalse
-
getPlayers
Gets aList
with all registeredPlayer
in the team
Note: The list exclude all entities. To get all entities of the team, you can usegetEntities(Team)
- Parameters:
team
- The team- Returns:
- a
List
with all registeredPlayer
-
getEntities
Gets aList
with all registeredLivingEntity
in the team
Note: The list exclude all players. To get all players of the team, you can usegetPlayers(Team)
- Parameters:
team
- The team- Returns:
- a
List
with all registeredLivingEntity
-
getTeams
Gets aSet
with all registeredTeam
's- Returns:
- a
Set
with all registeredTeam
's
-