Home Commands Examples Getting Started With Scripts Global Keywords

PlayerList

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.

script.zs
import crafttweaker.api.server.PlayerList;

Methods

Return Type: int

script.zs
// PlayerList.getMaxPlayers() as int
myPlayerList.getMaxPlayers();

Return Type: ServerPlayer?

script.zs
PlayerList.getPlayer(uuid as invalid) as ServerPlayer?
ParameterType
Parameter
uuid
Type
invalid

Return Type: ServerPlayer?

script.zs
PlayerList.getPlayerByName(name as string) as ServerPlayer?
ParameterType
Parameter
name
Type
string

Return Type: int

script.zs
// PlayerList.getPlayerCount() as int
myPlayerList.getPlayerCount();

Return Type: stdlib.List<ServerPlayer>

script.zs
// PlayerList.getPlayers() as stdlib.List<ServerPlayer>
myPlayerList.getPlayers();

Return Type: Server

script.zs
// PlayerList.getServer() as Server
myPlayerList.getServer();

Return Type: int

script.zs
// PlayerList.getSimulationDistance() as int
myPlayerList.getSimulationDistance();

Return Type: int

script.zs
// PlayerList.getViewDistance() as int
myPlayerList.getViewDistance();

Return Type: boolean

script.zs
// PlayerList.isAllowCheatsForAllPlayers() as boolean
myPlayerList.isAllowCheatsForAllPlayers();

Properties

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