Package net.minestom.server.scoreboard
Class Team
java.lang.Object
net.minestom.server.scoreboard.Team
- All Implemented Interfaces:
Audience,ForwardingAudience,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
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.Gets the prefix of the team.Gets the suffix of the team.@NotNull NamedTextColorGets the color of the team.Gets the display name of the team.Gets the registry name of the team.booleanboolean@NotNull 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.voidChanges the prefix of the team.voidsetSeeInvisiblePlayers(boolean value) voidChanges the suffix of the team.voidsetTeamColor(@NotNull NamedTextColor color) Changes the color of the team.voidsetTeamDisplayName(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(Component prefix) Changes the prefix of the team and sends an update packet.voidupdateSeeInvisiblePlayers(boolean value) voidupdateSuffix(Component suffix) Changes the suffix of the team and sends an update packet.voidupdateTeamColor(@NotNull NamedTextColor color) Changes the color of the team and sends an update packet.voidupdateTeamDisplayName(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
Changes the display name of the team.
Warning: This is only changed server side.- Parameters:
teamDisplayName- The new display name
-
updateTeamDisplayName
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
Changes the color of the team.
Warning: This is only changed on the server side.- Parameters:
color- The new team color- See Also:
-
updateTeamColor
Changes the color of the team and sends an update packet.- Parameters:
color- The new team color
-
setPrefix
Changes the prefix of the team.
Warning: This is only changed on the server side.- Parameters:
prefix- The new prefix
-
updatePrefix
Changes the prefix of the team and sends an update packet.- Parameters:
prefix- The new prefix
-
setSuffix
Changes the suffix of the team.
Warning: This is only changed on the server side.- Parameters:
suffix- The new suffix
-
updateSuffix
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
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
Gets the color of the team.- Returns:
- the team color
-
getPrefix
Gets the prefix of the team.- Returns:
- the team prefix
-
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
- Specified by:
pointersin interfaceForwardingAudience- Specified by:
pointersin interfacePointered
-