接口 Team
getScoreboard()
获取的计分板相关联.-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明void
将某条项目加入这个队伍.void
addPlayer
(OfflinePlayer player) 已过时。队伍可包含非玩家项目boolean
获取队伍成员能否互相攻击.boolean
获取此队伍能否看见处于隐身
状态效果下的队友.getColor()
获取队伍的颜色.获取此队伍的显示名.获取队伍内所有项目的集合.getName()
获取此队伍的名称.getOption
(Team.Option option) 获取队伍的一个选项.已过时。队伍可包含非玩家项目获取添加于队员名前的前缀.获取此队伍所附属的计分板.int
getSize()
获取此队伍的队员数.获取添加于队员名后的后缀.boolean
检测某项目是否在此队伍内.boolean
hasPlayer
(OfflinePlayer player) 已过时。队伍可包含非玩家项目boolean
removeEntry
(String entry) 移除队伍中的某条项目.boolean
removePlayer
(OfflinePlayer player) 已过时。队伍可包含非玩家项目void
setAllowFriendlyFire
(boolean enabled) 设置队伍成员能否互相攻击.void
setCanSeeFriendlyInvisibles
(boolean enabled) 设置此队伍能否看见处于隐身
状态效果下的队友.void
设置队伍的颜色.void
setDisplayName
(String displayName) 设置队伍的显示名称.void
setNameTagVisibility
(NameTagVisibility visibility) void
setOption
(Team.Option option, Team.OptionStatus status) 为队伍设置一个选项.void
设置添加于队员名前的前缀.void
设置添加于队员名后的后缀.void
从这个计分板上注销这个队伍.
-
方法详细资料
-
getName
获取此队伍的名称.原文:Gets the name of this Team
- 返回:
- 队伍名
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
getDisplayName
获取此队伍的显示名.原文:Gets the name displayed to entries for this team
- 返回:
- 队伍显示名
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setDisplayName
设置队伍的显示名称.原文:Sets the name displayed to entries for this team
- 参数:
displayName
- 队伍显示名- 抛出:
IllegalArgumentException
- 若 displayName 长度超过 128 个字符IllegalStateException
- 若此队伍已被注销
-
getPrefix
获取添加于队员名前的前缀.原文:Gets the prefix prepended to the display of entries on this team.
- 返回:
- 队员名前缀
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setPrefix
设置添加于队员名前的前缀.原文:Sets the prefix prepended to the display of entries on this team.
- 参数:
prefix
- 队员名前缀- 抛出:
IllegalArgumentException
- 若参数 prefix 为 nullIllegalArgumentException
- 若 prefix 长度超过 64 个字符IllegalStateException
- 若此队伍已被注销
-
getSuffix
获取添加于队员名后的后缀.原文:Gets the suffix appended to the display of entries on this team.
- 返回:
- 队员名后缀
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setSuffix
设置添加于队员名后的后缀.原文:Sets the suffix appended to the display of entries on this team.
- 参数:
suffix
- 要设置的队员名后缀- 抛出:
IllegalArgumentException
- 若参数 suffix 为 nullIllegalArgumentException
- 若 suffix 长度超过 64 个字符IllegalStateException
- 若此队伍已被注销
-
getColor
获取队伍的颜色.此颜色只代表队伍主要颜色, 其它颜色比如队员名前后缀的颜色由其前缀/后缀处理.
原文:Gets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- 返回:
- 队伍颜色, 默认为
ChatColor.RESET
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setColor
设置队伍的颜色.本方法只是设置了队伍主要颜色, 其它颜色比如队员名前后缀的颜色由其前缀/后缀处理.
原文:Sets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- 参数:
color
- 新颜色, 不能为 null. 使用ChatColor.RESET
重置颜色
-
allowFriendlyFire
获取队伍成员能否互相攻击.原文:Gets the team friendly fire state
- 返回:
- 如果允许互相攻击则为true
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setAllowFriendlyFire
设置队伍成员能否互相攻击.原文:Sets the team friendly fire state
- 参数:
enabled
- 如果允许互相攻击则为true- 抛出:
IllegalStateException
- 若此队伍已被注销
-
canSeeFriendlyInvisibles
- 返回:
- 如果隐身队友可被同队队友看见则为true
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setCanSeeFriendlyInvisibles
- 参数:
enabled
- 如果隐身队友可被同队队友看见则为true- 抛出:
IllegalStateException
- 若此队伍已被注销
-
getNameTagVisibility
获取此队伍的玩家名可见性.原文:Gets the team's ability to see name tags
- 返回:
- 当前设置的可见性
- 抛出:
IllegalArgumentException
- 若此队伍已被注销
-
setNameTagVisibility
设置此队伍的玩家名可见性.原文:Set's the team's ability to see name tags
- 参数:
visibility
- 要设置的 nameTagVisibility- 抛出:
IllegalArgumentException
- 若此队伍已被注销
-
getPlayers
已过时。队伍可包含非玩家项目获取队伍内所有玩家的集合.原文:Gets the Set of players on the team
- 返回:
- 队伍玩家集合
- 抛出:
IllegalStateException
- 若此队伍已被注销- 另请参阅:
-
getEntries
获取队伍内所有项目的集合.原文:Gets the Set of entries on the team
- 返回:
- 队伍项目集合
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
getSize
获取此队伍的队员数.原文:Gets the size of the team
- 返回:
- 队伍队员数
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
getScoreboard
Scoreboard getScoreboard()获取此队伍所附属的计分板.原文:Gets the Scoreboard to which this team is attached
- 返回:
- 管理此队伍的计分板, 如果此队伍已被
注销
则返回 null
-
addPlayer
@Deprecated 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.
- 参数:
player
- 要加入的玩家- 抛出:
IllegalArgumentException
- 若参数 player 为 nullIllegalStateException
- 若此队伍已被注销- 另请参阅:
-
addEntry
将某条项目加入这个队伍.这将使此项目离开其它队伍.
原文:This puts the specified entry onto this team for the scoreboard.
This will remove the entry from any other team on the scoreboard.
- 参数:
entry
- 要加入的项目- 抛出:
IllegalArgumentException
- 若参数 entry 为 nullIllegalStateException
- 若此队伍已被注销
-
removePlayer
@Deprecated boolean removePlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException 已过时。队伍可包含非玩家项目使某玩家离开此队伍.原文:Removes the player from this team.
- 参数:
player
- 要移除的玩家- 返回:
- 此玩家是否曾为队伍中的一员
- 抛出:
IllegalArgumentException
- 若参数 player 为 nullIllegalStateException
- 若此队伍已被注销- 另请参阅:
-
removeEntry
移除队伍中的某条项目.原文:Removes the entry from this team.
- 参数:
entry
- 要移除的项目- 返回:
- 此项目是否曾为队伍中的一员
- 抛出:
IllegalArgumentException
- 若参数 entry 为 nullIllegalStateException
- 若此队伍已被注销
-
unregister
从这个计分板上注销这个队伍.原文:Unregisters this team from the Scoreboard
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
hasPlayer
@Deprecated boolean hasPlayer(OfflinePlayer player) throws IllegalArgumentException, IllegalStateException 已过时。队伍可包含非玩家项目检测某玩家是否在此队伍内.原文:Checks to see if the specified player is a member of this team.
- 参数:
player
- 要查找的玩家- 返回:
- 如果在队伍内就返回true
- 抛出:
IllegalArgumentException
- 若参数 player 为 nullIllegalStateException
- 若此队伍已被注销- 另请参阅:
-
hasEntry
检测某项目是否在此队伍内.原文:Checks to see if the specified entry is a member of this team.
- 参数:
entry
- 要查找的项目- 返回:
- 如果在队伍内就返回true
- 抛出:
IllegalArgumentException
- 若参数 entry 为 nullIllegalStateException
- 若此队伍已被注销
-
getOption
获取队伍的一个选项.原文:Get an option for this team
- 参数:
option
- 要获取的选项- 返回:
- 选项状态值
- 抛出:
IllegalStateException
- 若此队伍已被注销
-
setOption
为队伍设置一个选项.原文:Set an option for this team
- 参数:
option
- 要设置的选项status
- 选项状态值- 抛出:
IllegalStateException
- 若此队伍已被注销
-