Interface TeamDisplay
@NonExtendable
public interface TeamDisplay
Represents the display properties of a scoreboard team.
Note: this interface is not thread-safe, meaning you can only use it from one thread at a time,
although it does not have to be the main thread.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an entry.booleanGets the can see friendly invisibles rule value, which is false by default.@NotNull TeamDisplaycanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles) Updates the can see friendly invisibles rule.@NotNull CollisionRule@NotNull TeamDisplaycollisionRule(@NotNull CollisionRule collisionRule) Updates the collision rule.@NotNull net.kyori.adventure.text.Component@NotNull TeamDisplaydisplayName(@NotNull net.kyori.adventure.text.ComponentLike displayName) Updates the display name.@NotNull Collection<String>entries()Gets the entries.boolean@NotNull TeamDisplayfriendlyFire(boolean friendlyFire) Updates the friendly fire rule.@NotNull NameTagVisibility@NotNull TeamDisplaynameTagVisibility(@NotNull NameTagVisibility nameTagVisibility) Updates the name tag visibility rule.@Nullable net.kyori.adventure.text.format.NamedTextColorGets the player color.@NotNull TeamDisplayplayerColor(@Nullable net.kyori.adventure.text.format.NamedTextColor playerColor) Updates the player color.@NotNull net.kyori.adventure.text.Componentprefix()Gets the prefix, which defaults toComponent.empty().@NotNull TeamDisplayprefix(@NotNull net.kyori.adventure.text.ComponentLike prefix) Updates the prefix.booleanremoveEntry(@NotNull String entry) Removes an entry.@NotNull net.kyori.adventure.text.Componentsuffix()Gets the suffix, which defaults toComponent.empty().@NotNull TeamDisplaysuffix(@NotNull net.kyori.adventure.text.ComponentLike suffix) Updates the suffix.@NotNull ScoreboardTeamteam()
-
Method Details
-
team
- Returns:
- team which this team display is assigned to
-
entries
Gets the entries. The entries specify which players are members of the team.- Returns:
- entries of the team.
-
addEntry
Adds an entry.- Parameters:
entry- entry to add- Returns:
- whether the entry was added
- See Also:
-
removeEntry
Removes an entry.- Parameters:
entry- entry to remove- Returns:
- whether the entry was removed
- See Also:
-
displayName
@NotNull @NotNull net.kyori.adventure.text.Component displayName()- Returns:
- display name, defaults to
Component.empty()
-
displayName
@NotNull @NotNull TeamDisplay displayName(@NotNull @NotNull net.kyori.adventure.text.ComponentLike displayName) Updates the display name.- Parameters:
displayName- new display name
-
prefix
@NotNull @NotNull net.kyori.adventure.text.Component prefix()Gets the prefix, which defaults toComponent.empty(). The suffix is prepended to all team members' names.- Returns:
- prefix, defaults to
Component.empty()
-
prefix
@NotNull @NotNull TeamDisplay prefix(@NotNull @NotNull net.kyori.adventure.text.ComponentLike prefix) Updates the prefix.- Parameters:
prefix- new prefix- See Also:
-
suffix
@NotNull @NotNull net.kyori.adventure.text.Component suffix()Gets the suffix, which defaults toComponent.empty(). The suffix is appended to all team members' names.- Returns:
- suffix
-
suffix
@NotNull @NotNull TeamDisplay suffix(@NotNull @NotNull net.kyori.adventure.text.ComponentLike suffix) Updates the suffix.- Parameters:
suffix- new suffix- See Also:
-
friendlyFire
boolean friendlyFire()- Returns:
- friendly fire rule value, defaults to false
-
friendlyFire
Updates the friendly fire rule.- Parameters:
friendlyFire- new rule value
-
canSeeFriendlyInvisibles
boolean canSeeFriendlyInvisibles()Gets the can see friendly invisibles rule value, which is false by default. If true, team members can see other members with the invisibility effect.- Returns:
- rule value
-
canSeeFriendlyInvisibles
Updates the can see friendly invisibles rule.- Parameters:
canSeeFriendlyInvisibles- new rule value- See Also:
-
nameTagVisibility
- Returns:
- name tag visibility rule value
-
nameTagVisibility
@NotNull @NotNull TeamDisplay nameTagVisibility(@NotNull @NotNull NameTagVisibility nameTagVisibility) Updates the name tag visibility rule.- Parameters:
nameTagVisibility- new rule value
-
collisionRule
- Returns:
- collision rule
- Since:
- Minecraft 1.9
-
collisionRule
Updates the collision rule.- Parameters:
collisionRule- new rule value- Since:
- Minecraft 1.9
-
playerColor
@Nullable @Nullable net.kyori.adventure.text.format.NamedTextColor playerColor()Gets the player color. The player color is the color player name tags are displayed in. It is also used for displaying team specific sidebars with theObjectiveDisplaySlot.TeamSidebar} display slot.- Returns:
- player color
-
playerColor
@NotNull @NotNull TeamDisplay playerColor(@Nullable @Nullable net.kyori.adventure.text.format.NamedTextColor playerColor) Updates the player color.- Parameters:
playerColor- new player color- See Also:
-