PlayerList
Link to playerlist
Importing the class
Link to importing-the-class
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;
Methods
Link to methods
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?
Parameter | Type |
---|---|
Parameter uuid | Type invalid |
Name: getPlayerByName
Return Type: ServerPlayer?
ZenScript CopyPlayerList.getPlayerByName($$0 as string) as ServerPlayer?
Parameter | Type |
---|---|
Parameter $$0 | Type 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();
Properties
Link to properties
名称 | Type | Has Getter | Has Setter |
---|---|---|---|
名称 isAllowCheatsForAllPlayers | Type boolean型 | Has Getter true | Has Setter false |
名称 maxPlayers | Type int | Has Getter true | Has Setter false |
名称 playerCount | Type int | Has Getter true | Has Setter false |
名称 players | Type stdlib.List<ServerPlayer> | Has Getter true | Has Setter false |
名称 server | Type Server | Has Getter true | Has Setter false |
名称 simulationDistance | Type int | Has Getter true | Has Setter false |
名称 viewDistance | Type int | Has Getter true | Has Setter false |