public interface Team
A team is comprised of different members, represented by Text
objects.
While any Text
can be added to a team, certain Text
s convey a special
meaning.
Examples of this include players, whose names gain the prefix and suffix of the team they are on.
Modifier and Type | Method and Description |
---|---|
void |
addMember(Text member)
Adds the specified
Text to this team. |
boolean |
allowFriendlyFire()
Gets whether friendly fire is enabled.
|
boolean |
canSeeFriendlyInvisibles()
Gets whether invisible team members are shown.
|
TextColor |
getColor()
Gets the color of this team.
|
Visibility |
getDeathTextVisibility()
Gets the
Visibility which controls who death Texts
for players on this team are visible to. |
Text |
getDisplayName()
Gets the name displayed to users for this team.
|
Set<Text> |
getMembers()
Gets the
Text s representing the members of this team. |
String |
getName()
Gets the name of this team.
|
Visibility |
getNameTagVisibility()
Gets the
Visibility which controls to who nametags
of players on this team are visible to. |
Text |
getPrefix()
Gets the prefix prepended to the display name of users on this team.
|
Set<Scoreboard> |
getScoreboards()
|
Text |
getSuffix()
Gets the suffix appended to the display name of users on this team.
|
boolean |
removeMember(Text member)
Removes the specified
Text from this team. |
void |
setAllowFriendlyFire(boolean enabled)
Sets whether friendly fire is enabled.
|
void |
setCanSeeFriendlyInvisibles(boolean enabled)
Sets whether invisible team members are shown.
|
void |
setColor(TextColor color)
Sets the color of this team.
|
void |
setDeathTextVisibility(Visibility visibility)
Sets the
Visibility which controls who death Texts
of players on this team are visible to. |
void |
setDisplayName(Text displayName)
Sets the name displayed to users for this team.
|
void |
setNameTagVisibility(Visibility visibility)
Sets the
Visibility which controls to who nametags
of players on this team are visible to. |
void |
setPrefix(Text prefix)
Sets the prefix prepended to the display name of users on this team.
|
void |
setSuffix(Text suffix)
Sets the suffix appended to the display name of users on this team.
|
String getName()
Text getDisplayName()
TextColor getColor()
The team's color is a distinct concept from its prefix or suffix. It is only used for colored sidebar display slots, and certain statistic criteria.
void setColor(TextColor color) throws IllegalArgumentException
The team's color is a distinct concept from its prefix or suffix. It is only used for colored sidebar display slots, and certain statistic criteria.
color
- The team colorIllegalArgumentException
- If color is TextColors.RESET
void setDisplayName(Text displayName) throws IllegalArgumentException
displayName
- The Text
to useIllegalArgumentException
- If displayName is longer than 32
charactersText getPrefix()
void setPrefix(Text prefix) throws IllegalArgumentException
prefix
- The new prefix for this teamIllegalArgumentException
- If prefix is longer than 16
charactersText getSuffix()
void setSuffix(Text suffix) throws IllegalArgumentException
suffix
- The new suffix for this team.IllegalArgumentException
- If suffix is longer than 16
charactersboolean allowFriendlyFire()
void setAllowFriendlyFire(boolean enabled)
enabled
- Whether friendly fire is enabledboolean canSeeFriendlyInvisibles()
void setCanSeeFriendlyInvisibles(boolean enabled)
enabled
- Whether to show invisible teammatesVisibility getNameTagVisibility()
Visibility
which controls to who nametags
of players on this team are visible to.Visibility
for this team's nametagsvoid setNameTagVisibility(Visibility visibility)
Visibility
which controls to who nametags
of players on this team are visible to.visibility
- The Visibility
for this team's nametagsVisibility getDeathTextVisibility()
Visibility
which controls who death Texts
for players on this team are visible to.Visibility
for this team's death Textsvoid setDeathTextVisibility(Visibility visibility)
Visibility
which controls who death Texts
of players on this team are visible to.visibility
- The Visibility
for this team's death TextsSet<Text> getMembers()
Text
s representing the members of this team.Text
s for this team's membersvoid addMember(Text member)
Text
to this team.
While any Text
may be added, the Text
to use should normally be obtained by calling TeamMember.getTeamRepresentation()
on a TeamMember
, such as a Player
.
member
- the Text
to addboolean removeMember(Text member)
Text
from this team.
While any Text
may be removed, the Text
to use should normally be obtained by calling TeamMember.getTeamRepresentation()
on a TeamMember
, such as a Player
.
Set<Scoreboard> getScoreboards()
Set
of parent Scoreboard
s this Team
is
registered to