Interface ZentrixTeam
Teams are created when players join a game and are used to group players together. In solo games, each player is their own team.
Example Usage
ZentrixTeam team = ZentrixProvider.get()
.getTeamService()
.getPlayerTeam(player)
.orElse(null);
if (team != null) {
String name = team.getDisplayName();
String color = team.getColor();
int aliveCount = team.getAliveMemberCount();
boolean eliminated = team.isEliminated();
}
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionintGets the number of alive members in this team.@NotNull StringGets the chat format template for this team.@NotNull StringgetColor()Gets the team's color code.@NotNull StringGets the team's display name with color codes.intGets the current number of members in this team.@NotNull Collection<UUID> Gets all member UUIDs of this team.@NotNull StringGets the nametag format template for this team.@NotNull StringGets the team's symbol.@NotNull StringGets the team's unique identifier.intGets the team number (1-indexed).booleanChecks if a specific player is a member of this team.booleanChecks if this team is eliminated.booleanisEmpty()Checks if the team is empty (no members at all).booleanChecks if friendly fire is enabled for this team.booleanisFull(int maxSize) Checks if the team is full based on the game's team size limit.
-
Method Details
-
getTeamId
Gets the team's unique identifier.Format: "team-{number}" (e.g., "team-1", "team-2")
- Returns:
- The team ID (never null)
-
getTeamNumber
int getTeamNumber()Gets the team number (1-indexed).This is a sequential number assigned when the team is created.
- Returns:
- The team number (e.g., 1, 2, 3, ...)
-
getDisplayName
Gets the team's display name with color codes.This is the formatted name shown in chat and GUIs. Supports MiniMessage format and legacy color codes.
- Returns:
- The display name (never null)
-
getColor
Gets the team's color code.This can be a hex color (e.g., "invalid input: '&#'FF5555") or legacy color code.
- Returns:
- The color code (never null)
-
getSymbol
Gets the team's symbol.The symbol is a short text/character that represents the team, often used in scoreboards and nametags.
- Returns:
- The team symbol (never null)
-
getChatFormat
Gets the chat format template for this team.Placeholders:
{color}- Team color{team}- Team name{player}- Player name{message}- Chat message
- Returns:
- The chat format template (never null)
-
getNametagFormat
Gets the nametag format template for this team.Placeholders:
{color}- Team color{player}- Player name
- Returns:
- The nametag format template (never null)
-
isFriendlyFireEnabled
boolean isFriendlyFireEnabled()Checks if friendly fire is enabled for this team.When enabled, teammates can damage each other.
- Returns:
trueif teammates can damage each other
-
getMemberIds
Gets all member UUIDs of this team.This includes both alive and eliminated members who were part of this team during the game.
- Returns:
- An unmodifiable collection of member UUIDs (never null)
-
getMemberCount
int getMemberCount()Gets the current number of members in this team.This is the total count, including eliminated members.
- Returns:
- The total member count
-
getAliveMemberCount
int getAliveMemberCount()Gets the number of alive members in this team.Alive members are those who have not been eliminated.
- Returns:
- The count of alive members
-
isEliminated
boolean isEliminated()Checks if this team is eliminated.A team is eliminated when all its members have been killed or left the game.
- Returns:
trueif the team has no alive members
-
isEmpty
boolean isEmpty()Checks if the team is empty (no members at all).- Returns:
trueif the team has no members
-
hasMember
Checks if a specific player is a member of this team.- Parameters:
playerId- The player's UUID- Returns:
trueif the player is on this team
-
isFull
boolean isFull(int maxSize) Checks if the team is full based on the game's team size limit.- Parameters:
maxSize- The maximum team size for the game type- Returns:
trueif the team has reached the maximum size
-