org.bukkit.scoreboard
Interface Team


public interface Team

A team on a scoreboard that has a common display theme and other properties. This team is only relevant to the display of the associated scoreboard.


Method Summary
 void addPlayer(OfflinePlayer player)
          This puts the specified player onto this team for the scoreboard.
 boolean allowFriendlyFire()
          Gets the team friendly fire state
 boolean canSeeFriendlyInvisibles()
          Gets the team's ability to see invisible teammates.
 String getDisplayName()
          Gets the name displayed to players for this team
 String getName()
          Gets the name of this Team
 Set<OfflinePlayer> getPlayers()
          Gets the Set of players on the team
 String getPrefix()
          Sets the prefix prepended to the display of players on this team.
 Scoreboard getScoreboard()
          Gets the Scoreboard to which this team is attached
 int getSize()
          Gets the size of the team
 String getSuffix()
          Gets the suffix appended to the display of players on this team.
 boolean hasPlayer(OfflinePlayer player)
          Checks to see if the specified player is a member of this team.
 boolean removePlayer(OfflinePlayer player)
          Removes the player from this team.
 void setAllowFriendlyFire(boolean enabled)
          Sets the team friendly fire state
 void setCanSeeFriendlyInvisibles(boolean enabled)
          Sets the team's ability to see invisible invisible teammates.
 void setDisplayName(String displayName)
          Sets the name displayed to players for this team
 void setPrefix(String prefix)
          Sets the prefix prepended to the display of players on this team.
 void setSuffix(String suffix)
          Sets the suffix appended to the display of players on this team.
 void unregister()
          Unregisters this team from the Scoreboard
 

Method Detail

getName

String getName()
               throws IllegalStateException
Gets the name of this Team

Returns:
Objective name
Throws:
IllegalStateException - if this team has been unregistered

getDisplayName

String getDisplayName()
                      throws IllegalStateException
Gets the name displayed to players for this team

Returns:
Team display name
Throws:
IllegalStateException - if this team has been unregistered

setDisplayName

void setDisplayName(String displayName)
                    throws IllegalStateException,
                           IllegalArgumentException
Sets the name displayed to players for this team

Parameters:
displayName - New display name
Throws:
IllegalArgumentException - if displayName is longer than 32 characters.
IllegalStateException - if this team has been unregistered

getPrefix

String getPrefix()
                 throws IllegalStateException
Sets the prefix prepended to the display of players on this team.

Returns:
Team prefix
Throws:
IllegalStateException - if this team has been unregistered

setPrefix

void setPrefix(String prefix)
               throws IllegalStateException,
                      IllegalArgumentException
Sets the prefix prepended to the display of players on this team.

Parameters:
prefix - New prefix
Throws:
IllegalArgumentException - if prefix is null
IllegalArgumentException - if prefix is longer than 16 characters
IllegalStateException - if this team has been unregistered

getSuffix

String getSuffix()
                 throws IllegalStateException
Gets the suffix appended to the display of players on this team.

Returns:
the team's current suffix
Throws:
IllegalStateException - if this team has been unregistered

setSuffix

void setSuffix(String suffix)
               throws IllegalStateException,
                      IllegalArgumentException
Sets the suffix appended to the display of players on this team.

Parameters:
suffix - the new suffix for this team.
Throws:
IllegalArgumentException - if suffix is null
IllegalArgumentException - if suffix is longer than 16 characters
IllegalStateException - if this team has been unregistered

allowFriendlyFire

boolean allowFriendlyFire()
                          throws IllegalStateException
Gets the team friendly fire state

Returns:
true if friendly fire is enabled
Throws:
IllegalStateException - if this team has been unregistered

setAllowFriendlyFire

void setAllowFriendlyFire(boolean enabled)
                          throws IllegalStateException
Sets the team friendly fire state

Parameters:
enabled - true if friendly fire is to be allowed
Throws:
IllegalStateException - if this team has been unregistered

canSeeFriendlyInvisibles

boolean canSeeFriendlyInvisibles()
                                 throws IllegalStateException
Gets the team's ability to see invisible teammates.

Returns:
true if team members can see invisible members
Throws:
IllegalStateException - if this team has been unregistered

setCanSeeFriendlyInvisibles

void setCanSeeFriendlyInvisibles(boolean enabled)
                                 throws IllegalStateException
Sets the team's ability to see invisible invisible teammates.

Parameters:
enabled - true if invisible teammates are to be visible
Throws:
IllegalStateException - if this team has been unregistered

getPlayers

Set<OfflinePlayer> getPlayers()
                              throws IllegalStateException
Gets the Set of players on the team

Returns:
players on the team
Throws:
IllegalStateException - if this team has been unregistered

getSize

int getSize()
            throws IllegalStateException
Gets the size of the team

Returns:
number of players on the team
Throws:
IllegalStateException - if this team has been unregistered

getScoreboard

Scoreboard getScoreboard()
Gets the Scoreboard to which this team is attached

Returns:
Owning scoreboard, or null if this team has been unregistered

addPlayer

void addPlayer(OfflinePlayer player)
               throws IllegalStateException,
                      IllegalArgumentException
This puts the specified player onto this team for the scoreboard.

This will remove the player from any other team on the scoreboard.

Parameters:
player - the player to add
Throws:
IllegalArgumentException - if player is null
IllegalStateException - if this team has been unregistered

removePlayer

boolean removePlayer(OfflinePlayer player)
                     throws IllegalStateException,
                            IllegalArgumentException
Removes the player from this team.

Parameters:
player - the player to remove
Returns:
if the player was on this team
Throws:
IllegalArgumentException - if player is null
IllegalStateException - if this team has been unregistered

unregister

void unregister()
                throws IllegalStateException
Unregisters this team from the Scoreboard

Throws:
IllegalStateException - if this team has been unregistered

hasPlayer

boolean hasPlayer(OfflinePlayer player)
                  throws IllegalArgumentException,
                         IllegalStateException
Checks to see if the specified player is a member of this team.

Parameters:
player - the player to search for
Returns:
true if the player is a member of this team
Throws:
IllegalArgumentException - if player is null
IllegalStateException - if this team has been unregistered


Copyright © 2013. All Rights Reserved.