Class Team

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

public class Team
extends java.lang.Object
This object represents a team on a scoreboard that has a common display theme and other properties.
  • Constructor Details

    • Team

      protected Team​(java.lang.String teamName)
      Default constructor to creates a team.
      Parameters:
      teamName - The registry name for the team
  • Method Details

    • addMember

      public void addMember​(java.lang.String member)
      Adds a member to the Team.
      This member can be a Player or an LivingEntity.
      Parameters:
      member - The member to be added
    • removeMember

      public void removeMember​(java.lang.String member)
      Removes a member from the Team.
      Parameters:
      member - The member to be removed
    • setTeamDisplayName

      public void setTeamDisplayName​(ColoredText teamDisplayName)
      Changes the display name of the team.

      Warning: This is only changed on the server side.
      Parameters:
      teamDisplayName - The new display name
    • updateTeamDisplayName

      public void updateTeamDisplayName​(ColoredText teamDisplayName)
      Changes the display name of the team and sends an update packet.
      Parameters:
      teamDisplayName - The new display name
    • setNameTagVisibility

      public void setNameTagVisibility​(TeamsPacket.NameTagVisibility visibility)
      Changes the TeamsPacket.NameTagVisibility of the team.

      Warning: This is only changed on the server side.
      Parameters:
      visibility - The new tag visibility
    • updateNameTagVisibility

      public void updateNameTagVisibility​(TeamsPacket.NameTagVisibility nameTagVisibility)
      Changes the TeamsPacket.NameTagVisibility of the team and sends an update packet.
      Parameters:
      nameTagVisibility - The new tag visibility
    • setCollisionRule

      public void setCollisionRule​(TeamsPacket.CollisionRule rule)
      Changes the TeamsPacket.CollisionRule of the team.

      Warning: This is only changed on the server side.
      Parameters:
      rule - The new rule
    • updateCollisionRule

      public void updateCollisionRule​(TeamsPacket.CollisionRule collisionRule)
      Changes the collision rule of the team and sends an update packet.
      Parameters:
      collisionRule - The new collision rule
    • setTeamColor

      public void setTeamColor​(ChatColor color)
      Changes the color of the team.

      Warning: This is only changed on the server side.
      Parameters:
      color - The new team color
    • updateTeamColor

      public void updateTeamColor​(ChatColor teamColor)
      Changes the color of the team and sends an update packet.
      Parameters:
      teamColor - The new team color
    • setPrefix

      public void setPrefix​(ColoredText prefix)
      Changes the prefix of the team.

      Warning: This is only changed on the server side.
      Parameters:
      prefix - The new prefix
    • updatePrefix

      public void updatePrefix​(ColoredText prefix)
      Changes the prefix of the team and sends an update packet.
      Parameters:
      prefix - The new prefix
    • setSuffix

      public void setSuffix​(ColoredText suffix)
      Changes the suffix of the team.

      Warning: This is only changed on the server side.
      Parameters:
      suffix - The new suffix
    • updateSuffix

      public void updateSuffix​(ColoredText suffix)
      Changes the suffix of the team and sends an update packet.
      Parameters:
      suffix - The new suffix
    • setFriendlyFlags

      public void setFriendlyFlags​(byte flag)
      Changes the friendly flags of the team.

      Warning: This is only changed on the server side.
      Parameters:
      flag - The new friendly flag
    • updateFriendlyFlags

      public void updateFriendlyFlags​(byte flag)
      Changes the friendly flags of the team and sends an update packet.
      Parameters:
      flag - The new friendly flag
    • getTeamName

      public java.lang.String getTeamName()
      Gets the registry name of the team.
      Returns:
      the registry name
    • createTeamsCreationPacket

      public TeamsPacket createTeamsCreationPacket()
      Creates the creation packet to add a team.
      Returns:
      the packet to add the team
    • createTeamDestructionPacket

      public TeamsPacket createTeamDestructionPacket()
      Creates an destruction packet to remove the team.
      Returns:
      the packet to remove the team
    • getMembers

      public java.util.Set<java.lang.String> getMembers()
      Obtains an unmodifiable Set of registered players who are on the team.
      Returns:
      an unmodifiable Set of registered players
    • getTeamDisplayName

      public ColoredText getTeamDisplayName()
      Gets the display name of the team.
      Returns:
      the display name
    • getFriendlyFlags

      public byte getFriendlyFlags()
      Gets the friendly flags of the team.
      Returns:
      the friendly flags
    • getNameTagVisibility

      public TeamsPacket.NameTagVisibility getNameTagVisibility()
      Gets the tag visibility of the team.
      Returns:
      the tag visibility
    • getCollisionRule

      public TeamsPacket.CollisionRule getCollisionRule()
      Gets the collision rule of the team.
      Returns:
      the collision rule
    • getTeamColor

      public ChatColor getTeamColor()
      Gets the color of the team.
      Returns:
      the team color
    • getPrefix

      public ColoredText getPrefix()
      Gets the prefix of the team.
      Returns:
      the team prefix
    • getSuffix

      public ColoredText getSuffix()
      Gets the suffix of the team.
      Returns:
      the suffix team
    • getEntities

      public java.lang.String[] getEntities()
    • sendUpdatePacket

      public void sendUpdatePacket()