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 ForwardingAudience
ForwardingAudience.Single -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a member to theTeam.voidaddMembers(Collection<String> toAdd) Adds a members to theTeam.Creates an destruction packet to remove the team.Creates the creation packet to add a team.Gets the collision rule of the team.byteGets the friendly flags of the team.Obtains an unmodifiableSetof registered players who are on the team.Gets the tag visibility of the team.Gets an iterable of the players this audience contains.Gets the prefix of the team.Gets the suffix of the team.Gets the color of the team.Gets the display name of the team.Gets the registry name of the team.booleanbooleanpointers()voidremoveMember(String member) Removes a member from theTeam.voidremoveMembers(Collection<String> toRemove) Removes members from theTeam.voidSends anTeamsPacket.UpdateTeamActionaction packet.voidsetAllowFriendlyFire(boolean value) voidChanges theTeamsPacket.CollisionRuleof the team.voidsetFriendlyFlags(byte flag) Changes the friendly flags of the team.voidsetNameTagVisibility(TeamsPacket.NameTagVisibility visibility) Changes theTeamsPacket.NameTagVisibilityof the team.voidChanges the prefix of the team.voidsetSeeInvisiblePlayers(boolean value) voidChanges the suffix of the team.voidsetTeamColor(NamedTextColor color) Changes the color of the team.voidsetTeamDisplayName(Component teamDisplayName) Changes the display name of the team.voidupdateAllowFriendlyFire(boolean value) voidupdateCollisionRule(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(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(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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 ForwardingAudience
clearResourcePacks, closeDialog, deleteMessage, filterAudience, forEachAudience, openBook, playSound, removeResourcePacks, removeResourcePacks, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendResourcePacks, showDialogMethods inherited from interface PacketGroupingAudience
audiences, clearTitle, hideBossBar, playSound, playSound, playSound, resetTitle, sendActionBar, sendGroupedPacket, sendMessage, sendNotification, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, stopSoundMethods inherited from interface Pointered
get, getOrDefault, getOrDefaultFrom
-
Field Details
-
TEAM_POINTERS_SUPPLIER
-
-
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
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
-
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
-
getTeamDisplayName
-
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
-
getPrefix
-
getSuffix
-
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
-