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
Copy
import crafttweaker.api.server.PlayerList;

Name: getMaxPlayers

Return Type: int

ZenScript
Copy
// PlayerList.getMaxPlayers() as int

myPlayerList.getMaxPlayers();

Name: getPlayer

Return Type: ServerPlayer?

ZenScript
Copy
PlayerList.getPlayer(uuid as stdlib.UUID) as ServerPlayer?
ParameterType
Parameter
uuid
Type
stdlib.UUID

Name: getPlayerByName

Return Type: ServerPlayer?

ZenScript
Copy
PlayerList.getPlayerByName(name as string) as ServerPlayer?
ParameterType
Parameter
name
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();

Link to getSimulationDistance

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();

Link to isAllowCheatsForAllPlayers

Name: isAllowCheatsForAllPlayers

Return Type: boolean

ZenScript
Copy
// PlayerList.isAllowCheatsForAllPlayers() as boolean

myPlayerList.isAllowCheatsForAllPlayers();
NameTypeHas GetterHas Setter
Name
isAllowCheatsForAllPlayers
Type
boolean
Has Getter
true
Has Setter
false
Name
maxPlayers
Type
int
Has Getter
true
Has Setter
false
Name
playerCount
Type
int
Has Getter
true
Has Setter
false
Name
players
Type
stdlib.List<ServerPlayer>
Has Getter
true
Has Setter
false
Name
server
Type
Server
Has Getter
true
Has Setter
false
Name
simulationDistance
Type
int
Has Getter
true
Has Setter
false
Name
viewDistance
Type
int
Has Getter
true
Has Setter
false