Package net.minestom.server.scoreboard
Class TeamManager
java.lang.Object
net.minestom.server.scoreboard.TeamManager
An object which manages all the
Team
's-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateBuilder
(@NotNull String name) Initializes a newTeamBuilder
for creating a teamcreateTeam
(@NotNull String name) Creates aTeam
with only the registry namecreateTeam
(String name, Component displayName, Component prefix, NamedTextColor teamColor, Component suffix) Creates aTeam
with the registry name, display name, prefix, suffix and the team colrocreateTeam
(String name, Component prefix, NamedTextColor teamColor, Component suffix) Creates aTeam
with the registry name, prefix, suffix and the team formatboolean
deleteTeam
(@NotNull String registryName) Deletes aTeam
boolean
deleteTeam
(@NotNull Team team) Deletes aTeam
boolean
Checks if the given name a registry name of a registeredTeam
boolean
Checks if the givenTeam
registeredgetEntities
(Team team) getPlayers
(Team team) Gets aTeam
with the given namegetTeams()
protected void
registerNewTeam
(@NotNull 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
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
Creates aTeam
with the registry name, prefix, suffix and the team format- Parameters:
name
- The registry nameprefix
- The team prefixteamColor
- The team formatsuffix
- 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 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
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)
-
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
-