Package net.minestom.server.scoreboard
Class Team
java.lang.Object
net.minestom.server.scoreboard.Team
- All Implemented Interfaces:
net.kyori.adventure.audience.Audience,net.kyori.adventure.audience.ForwardingAudience,net.kyori.adventure.pointer.Pointered,PacketGroupingAudience
This object represents a team on a scoreboard that has a common display theme and other properties.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience
net.kyori.adventure.audience.ForwardingAudience.Single -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a member to theTeam.voidaddMembers(@NotNull Collection<@NotNull String> toAdd) Adds a members to theTeam.@NotNull TeamsPacketCreates an destruction packet to remove the team.@NotNull TeamsPacketCreates the creation packet to add a team.@NotNull TeamsPacket.CollisionRuleGets the collision rule of the team.byteGets the friendly flags of the team.Obtains an unmodifiableSetof registered players who are on the team.@NotNull TeamsPacket.NameTagVisibilityGets the tag visibility of the team.@NotNull Collection<Player> Gets an iterable of the players this audience contains.net.kyori.adventure.text.ComponentGets the prefix of the team.net.kyori.adventure.text.ComponentGets the suffix of the team.@NotNull net.kyori.adventure.text.format.NamedTextColorGets the color of the team.net.kyori.adventure.text.ComponentGets the display name of the team.Gets the registry name of the team.booleanboolean@NotNull net.kyori.adventure.pointer.Pointerspointers()voidremoveMember(@NotNull String member) Removes a member from theTeam.voidremoveMembers(@NotNull Collection<@NotNull String> toRemove) Removes members from theTeam.voidSends anTeamsPacket.UpdateTeamActionaction packet.voidsetAllowFriendlyFire(boolean value) voidsetCollisionRule(@NotNull TeamsPacket.CollisionRule rule) Changes theTeamsPacket.CollisionRuleof the team.voidsetFriendlyFlags(byte flag) Changes the friendly flags of the team.voidsetNameTagVisibility(@NotNull TeamsPacket.NameTagVisibility visibility) Changes theTeamsPacket.NameTagVisibilityof the team.voidsetPrefix(net.kyori.adventure.text.Component prefix) Changes the prefix of the team.voidsetSeeInvisiblePlayers(boolean value) voidsetSuffix(net.kyori.adventure.text.Component suffix) Changes the suffix of the team.voidsetTeamColor(@NotNull net.kyori.adventure.text.format.NamedTextColor color) Changes the color of the team.voidsetTeamDisplayName(net.kyori.adventure.text.Component teamDisplayName) Changes the display name of the team.voidupdateAllowFriendlyFire(boolean value) voidupdateCollisionRule(@NotNull TeamsPacket.CollisionRule collisionRule) Changes the collision rule of the team and sends an update packet.voidupdateFriendlyFlags(byte flag) Changes the friendly flags of the team and sends an update packet.voidupdateNameTagVisibility(@NotNull TeamsPacket.NameTagVisibility nameTagVisibility) Changes theTeamsPacket.NameTagVisibilityof the team and sends an update packet.voidupdatePrefix(net.kyori.adventure.text.Component prefix) Changes the prefix of the team and sends an update packet.voidupdateSeeInvisiblePlayers(boolean value) voidupdateSuffix(net.kyori.adventure.text.Component suffix) Changes the suffix of the team and sends an update packet.voidupdateTeamColor(@NotNull net.kyori.adventure.text.format.NamedTextColor color) Changes the color of the team and sends an update packet.voidupdateTeamDisplayName(net.kyori.adventure.text.Component teamDisplayName) Changes the display name of the team and sends an update packet.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.audience.Audience
deleteMessage, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSoundMethods inherited from interface net.kyori.adventure.audience.ForwardingAudience
clearResourcePacks, deleteMessage, filterAudience, forEachAudience, openBook, playSound, removeResourcePacks, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendResourcePacksMethods inherited from interface net.minestom.server.adventure.audience.PacketGroupingAudience
audiences, clearTitle, hideBossBar, playSound, playSound, playSound, resetTitle, sendActionBar, sendGroupedPacket, sendMessage, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom
-
Constructor Details
-
Team
Default constructor to creates a team.- Parameters:
teamName- The registry name for the team
-
-
Method Details
-
addMember
Adds a member to theTeam.
This member collection can containPlayerorLivingEntity. For players use their username, for entities use their UUID- Parameters:
member- The member to be added
-
addMembers
Adds a members to theTeam.
This member collection can containPlayerorLivingEntity. For players use their username, for entities use their UUID- Parameters:
toAdd- The members to be added
-
removeMember
Removes a member from theTeam.
This member collection can containPlayerorLivingEntity. For players use their username, for entities use their UUID- Parameters:
member- The member to be removed
-
removeMembers
Removes members from theTeam.
This member collection can containPlayerorLivingEntity. For players use their username, for entities use their UUID- Parameters:
toRemove- The members to be removed
-
setTeamDisplayName
public void setTeamDisplayName(net.kyori.adventure.text.Component teamDisplayName) Changes the display name of the team.
Warning: This is only changed server side.- Parameters:
teamDisplayName- The new display name
-
updateTeamDisplayName
public void updateTeamDisplayName(net.kyori.adventure.text.Component teamDisplayName) Changes the display name of the team and sends an update packet.- Parameters:
teamDisplayName- The new display name
-
setNameTagVisibility
Changes theTeamsPacket.NameTagVisibilityof the team.
Warning: This is only changed on the server side.- Parameters:
visibility- The new tag visibility- See Also:
-
updateNameTagVisibility
public void updateNameTagVisibility(@NotNull @NotNull TeamsPacket.NameTagVisibility nameTagVisibility) Changes theTeamsPacket.NameTagVisibilityof the team and sends an update packet.- Parameters:
nameTagVisibility- The new tag visibility
-
setCollisionRule
Changes theTeamsPacket.CollisionRuleof the team.
Warning: This is only changed on the server side.- Parameters:
rule- The new rule- See Also:
-
updateCollisionRule
Changes the collision rule of the team and sends an update packet.- Parameters:
collisionRule- The new collision rule
-
setTeamColor
public void setTeamColor(@NotNull @NotNull net.kyori.adventure.text.format.NamedTextColor color) Changes the color of the team.
Warning: This is only changed on the server side.- Parameters:
color- The new team color- See Also:
-
updateTeamColor
public void updateTeamColor(@NotNull @NotNull net.kyori.adventure.text.format.NamedTextColor color) Changes the color of the team and sends an update packet.- Parameters:
color- The new team color
-
setPrefix
public void setPrefix(net.kyori.adventure.text.Component 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(net.kyori.adventure.text.Component prefix) Changes the prefix of the team and sends an update packet.- Parameters:
prefix- The new prefix
-
setSuffix
public void setSuffix(net.kyori.adventure.text.Component 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(net.kyori.adventure.text.Component 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
-
setAllowFriendlyFire
public void setAllowFriendlyFire(boolean value) -
updateAllowFriendlyFire
public void updateAllowFriendlyFire(boolean value) -
isAllowFriendlyFire
public boolean isAllowFriendlyFire() -
setSeeInvisiblePlayers
public void setSeeInvisiblePlayers(boolean value) -
updateSeeInvisiblePlayers
public void updateSeeInvisiblePlayers(boolean value) -
isSeeInvisiblePlayers
public boolean isSeeInvisiblePlayers() -
getTeamName
Gets the registry name of the team.- Returns:
- the registry name
-
createTeamsCreationPacket
Creates the creation packet to add a team.- Returns:
- the packet to add the team
-
createTeamDestructionPacket
Creates an destruction packet to remove the team.- Returns:
- the packet to remove the team
-
getMembers
Obtains an unmodifiableSetof registered players who are on the team.- Returns:
- an unmodifiable
Setof registered players
-
getTeamDisplayName
public net.kyori.adventure.text.Component 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
Gets the tag visibility of the team.- Returns:
- the tag visibility
-
getCollisionRule
Gets the collision rule of the team.- Returns:
- the collision rule
-
getTeamColor
@NotNull public @NotNull net.kyori.adventure.text.format.NamedTextColor getTeamColor()Gets the color of the team.- Returns:
- the team color
-
getPrefix
public net.kyori.adventure.text.Component getPrefix()Gets the prefix of the team.- Returns:
- the team prefix
-
getSuffix
public net.kyori.adventure.text.Component getSuffix()Gets the suffix of the team.- Returns:
- the suffix team
-
sendUpdatePacket
public void sendUpdatePacket()Sends anTeamsPacket.UpdateTeamActionaction packet. -
getPlayers
Description copied from interface:PacketGroupingAudienceGets an iterable of the players this audience contains.- Specified by:
getPlayersin interfacePacketGroupingAudience- Returns:
- the connections
-
pointers
@NotNull public @NotNull net.kyori.adventure.pointer.Pointers pointers()- Specified by:
pointersin interfacenet.kyori.adventure.audience.ForwardingAudience- Specified by:
pointersin interfacenet.kyori.adventure.pointer.Pointered
-