PlayerList
Link to playerlist
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.server.PlayerList;
使用方式
Link to 使用方式
Name: getMaxPlayers
Return Type: int
ZenScript Copy// PlayerList.getMaxPlayers() as int
myPlayerList.getMaxPlayers();
Name: getPlayer
Return Type: ServerPlayer?
ZenScript CopyPlayerList.getPlayer(uuid as invalid) as ServerPlayer?
参数 | 类型 |
---|---|
参数 uuid | 类型 invalid |
Name: getPlayerByName
Return Type: ServerPlayer?
ZenScript CopyPlayerList.getPlayerByName($$0 as string) as ServerPlayer?
参数 | 类型 |
---|---|
参数 $$0 | 类型 string |
Name: getPlayerCount
Return Type: int
ZenScript Copy// PlayerList.getPlayerCount() as int
myPlayerList.getPlayerCount();
Name: getPlayers
Return Type: stdlib.List<ServerPlayer>
ZenScript Copy// PlayerList.getPlayers() as stdlib.List<ServerPlayer>
myPlayerList.getPlayers();
Name: getServer
Return Type: Server
ZenScript Copy// PlayerList.getServer() as Server
myPlayerList.getServer();
Name: getSimulationDistance
Return Type: int
ZenScript Copy// PlayerList.getSimulationDistance() as int
myPlayerList.getSimulationDistance();
Name: getViewDistance
Return Type: int
ZenScript Copy// PlayerList.getViewDistance() as int
myPlayerList.getViewDistance();
Name: isAllowCheatsForAllPlayers
Return Type: boolean
ZenScript Copy// PlayerList.isAllowCheatsForAllPlayers() as boolean
myPlayerList.isAllowCheatsForAllPlayers();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 isAllowCheatsForAllPlayers | 类型 布尔值 | 可获得 true | 可设置 false |
名称 maxPlayers | 类型 int | 可获得 true | 可设置 false |
名称 playerCount | 类型 int | 可获得 true | 可设置 false |
名称 players | 类型 stdlib.List<ServerPlayer> | 可获得 true | 可设置 false |
名称 server | 类型 Server | 可获得 true | 可设置 false |
名称 simulationDistance | 类型 int | 可获得 true | 可设置 false |
名称 viewDistance | 类型 int | 可获得 true | 可设置 false |