Interface ZentrixTeam


public interface ZentrixTeam
Represents a read-only view of a team in a Zentrix game.

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 Details

    • getTeamId

      @NotNull @NotNull String 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

      @NotNull @NotNull String 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

      @NotNull @NotNull String 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

      @NotNull @NotNull String 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

      @NotNull @NotNull String 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

      @NotNull @NotNull String 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:
      true if teammates can damage each other
    • getMemberIds

      @NotNull @NotNull Collection<UUID> 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:
      true if the team has no alive members
    • isEmpty

      boolean isEmpty()
      Checks if the team is empty (no members at all).
      Returns:
      true if the team has no members
    • hasMember

      boolean hasMember(@NotNull @NotNull UUID playerId)
      Checks if a specific player is a member of this team.
      Parameters:
      playerId - The player's UUID
      Returns:
      true if 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:
      true if the team has reached the maximum size