If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at
the top of the file.
import crafttweaker . api.game . Server;
Server extends ReentrantBlockableEventLoop <TickTask >
.
Server
implements the following interfaces:
CommandSource
Undocumented Interfaces ServerInfo
, ChunkIOErrorReporter
, ProfilerMeasured
, ProcessorHandle <Runnable >
, Executor
Gets the absolute maximum world size. // MinecraftServer.absoluteMaxWorldSize as int
myMinecraftServer . absoluteMaxWorldSize
Return Type:
int
Gets the absolute maximum world size. Returns : The absolute maximum world size.
// MinecraftServer.absoluteMaxWorldSize() as int;
myMinecraftServer . absoluteMaxWorldSize();
Return Type:
int
Checks if the commands from this source should return failure messages // MinecraftServer.acceptsFailure as bool
myMinecraftServer . acceptsFailure
Return Type:
bool
Checks if the commands from this source should return failure messages Returns : True if the commands from this source should return failure messages, false otherwise.
// MinecraftServer.acceptsFailure() as bool;
myMinecraftServer . acceptsFailure();
Return Type:
bool
Checks if the commands from this source should return successful messages // MinecraftServer.acceptsSuccess as bool
myMinecraftServer . acceptsSuccess
Return Type:
bool
Checks if the commands from this source should return successful messages Returns : True if the commands from this source should return successful messages, false otherwise.
// MinecraftServer.acceptsSuccess() as bool;
myMinecraftServer . acceptsSuccess();
Return Type:
bool
Gets all levels. myMinecraftServer . allLevels
Return Type:
Iterable <ServerLevel >
Gets all levels. Returns : All levels.
// MinecraftServer.allLevels() as Iterable< ServerLevel >; myMinecraftServer . allLevels();
Return Type:
Iterable <ServerLevel >
Checks if the command source always accepts. // MinecraftServer.alwaysAccepts as bool
myMinecraftServer . alwaysAccepts
Return Type:
bool
Checks if the command source always accepts. Returns : True if the command source always accepts, false otherwise.
// MinecraftServer.alwaysAccepts() as bool;
myMinecraftServer . alwaysAccepts();
Return Type:
bool
Checks if NPCs are enabled. // MinecraftServer.areNpcsEnabled as bool
myMinecraftServer . areNpcsEnabled
Return Type:
bool
Checks if NPCs are enabled. Returns : True if NPCs are enabled, false otherwise.
// MinecraftServer.areNpcsEnabled() as bool;
myMinecraftServer . areNpcsEnabled();
Return Type:
bool
Gets the current smoothed tick time. // MinecraftServer.currentSmoothedTickTime as float
myMinecraftServer . currentSmoothedTickTime
Return Type:
float
Gets the current smoothed tick time. Returns : The current smoothed tick time.
// MinecraftServer.currentSmoothedTickTime() as float;
myMinecraftServer . currentSmoothedTickTime();
Return Type:
float
Gets the default game type. // MinecraftServer.defaultGameTime as GameType myMinecraftServer . defaultGameTime
Return Type:
GameType
Gets the default game type. Returns : The default game type.
// MinecraftServer.defaultGameTime() as GameType ; myMinecraftServer . defaultGameTime();
Return Type:
GameType
Runs a command, if silent is true, the output is hidden. // MinecraftServer.executeCommand(command as string, silent as bool = false);
myMinecraftServer . executeCommand( "time set day" , true );
Parameters:
command: string
Type: string
silent: bool
(optional) Type: bool
Default Value: false
let a player send a command, if silent is true, the output is hidden. // MinecraftServer.executeCommand(command as string, player as Player , silent as bool = false); myMinecraftServer . executeCommand( "time set day" , player, true );
Parameters:
command: string
Type: string
silent: bool
(optional) Type: bool
Default Value: false
Gets the forced game type. // MinecraftServer.forcedGameType as GameType myMinecraftServer . forcedGameType
Return Type:
GameType
Gets the forced game type. Returns : The forced game type.
// MinecraftServer.forcedGameType() as GameType ; myMinecraftServer . forcedGameType();
Return Type:
GameType
Gets a level by its key. Returns : The level.
myMinecraftServer . getLevel(myResourceLocation);
Return Type:
ServerLevel
Gets the spawn radius. Returns : The spawn radius.
// MinecraftServer.getSpawnRadius(level as ServerLevel ) as int; myMinecraftServer . getSpawnRadius(myServerLevel);
Return Type:
int
Checks if command blocks are enabled. // MinecraftServer.isCommandBlockEnabled as bool
myMinecraftServer . isCommandBlockEnabled
Return Type:
bool
Checks if command blocks are enabled. Returns : True if command blocks are enabled, false otherwise.
// MinecraftServer.isCommandBlockEnabled() as bool;
myMinecraftServer . isCommandBlockEnabled();
Return Type:
bool
Checks if the server is dedicated. // MinecraftServer.isDedicatedServer as bool
myMinecraftServer . isDedicatedServer
Return Type:
bool
Checks if the server is dedicated. Returns : True if the server is dedicated, false otherwise.
// MinecraftServer.isDedicatedServer() as bool;
myMinecraftServer . isDedicatedServer();
Return Type:
bool
Checks if the whitelist is enforced. // MinecraftServer.isEnforceWhitelist as bool
myMinecraftServer . isEnforceWhitelist
Return Type:
bool
Checks if the whitelist is enforced. Returns : True if the whitelist is enforced, false otherwise.
// MinecraftServer.isEnforceWhitelist() as bool;
myMinecraftServer . isEnforceWhitelist();
Return Type:
bool
Checks if flight is allowed. // MinecraftServer.isFlightAllowed as bool
myMinecraftServer . isFlightAllowed
Return Type:
bool
Checks if flight is allowed. Returns : True if flight is allowed, false otherwise.
// MinecraftServer.isFlightAllowed() as bool;
myMinecraftServer . isFlightAllowed();
Return Type:
bool
Checks if the server is hardcore. // MinecraftServer.isHardcore as bool
myMinecraftServer . isHardcore
Return Type:
bool
Checks if the server is hardcore. Returns : True if the server is hardcore, false otherwise.
// MinecraftServer.isHardcore() as bool;
myMinecraftServer . isHardcore();
Return Type:
bool
Checks if PvP is allowed. // MinecraftServer.isPvpAllowed as bool
myMinecraftServer . isPvpAllowed
Return Type:
bool
Checks if PvP is allowed. Returns : True if PvP is allowed, false otherwise.
// MinecraftServer.isPvpAllowed() as bool;
myMinecraftServer . isPvpAllowed();
Return Type:
bool
Checks if the server is ready. // MinecraftServer.isReady as bool
myMinecraftServer . isReady
Return Type:
bool
Checks if the server is ready. Returns : True if the server is ready, false otherwise.
// MinecraftServer.isReady() as bool;
myMinecraftServer . isReady();
Return Type:
bool
Checks if the server is running. // MinecraftServer.isRunning as bool
myMinecraftServer . isRunning
Return Type:
bool
Checks if the server is running. Returns : True if the server is running, false otherwise.
// MinecraftServer.isRunning() as bool;
myMinecraftServer . isRunning();
Return Type:
bool
Checks if the server is shutting down. // MinecraftServer.isShutdown as bool
myMinecraftServer . isShutdown
Return Type:
bool
Checks if the server is shutting down. Returns : True if the server is shutting down, false otherwise.
// MinecraftServer.isShutdown() as bool;
myMinecraftServer . isShutdown();
Return Type:
bool
Checks if the server is singleplayer. // MinecraftServer.isSingleplayer as bool
myMinecraftServer . isSingleplayer
Return Type:
bool
Checks if the server is singleplayer. Returns : True if the server is singleplayer, false otherwise.
// MinecraftServer.isSingleplayer() as bool;
myMinecraftServer . isSingleplayer();
Return Type:
bool
Checks if animals are spawning. // MinecraftServer.isSpawningAnimals as bool
myMinecraftServer . isSpawningAnimals
Return Type:
bool
Checks if animals are spawning. Returns : True if animals are spawning, false otherwise.
// MinecraftServer.isSpawningAnimals() as bool;
myMinecraftServer . isSpawningAnimals();
Return Type:
bool
Checks if monsters are spawning. // MinecraftServer.isSpawningMonsters as bool
myMinecraftServer . isSpawningMonsters
Return Type:
bool
Checks if monsters are spawning. Returns : True if monsters are spawning, false otherwise.
// MinecraftServer.isSpawningMonsters() as bool;
myMinecraftServer . isSpawningMonsters();
Return Type:
bool
Checks if the server is stopped. // MinecraftServer.isStopped as bool
myMinecraftServer . isStopped
Return Type:
bool
Checks if the server is stopped. Returns : True if the server is stopped, false otherwise.
// MinecraftServer.isStopped() as bool;
myMinecraftServer . isStopped();
Return Type:
bool
Checks if a position is under spawn protection. Returns : True if the position is under spawn protection, false otherwise.
myMinecraftServer . isUnderSpawnProtection(myServerLevel, myBlockPos, myPlayer);
Return Type:
bool
Gets the keys of all levels. myMinecraftServer . levelKeys
Return Type:
List <ResourceLocation >
Gets the keys of all levels. Returns : The keys of all levels.
myMinecraftServer . levelKeys();
Return Type:
List <ResourceLocation >
Gets the maximum number of players. // MinecraftServer.maxPlayer as int
myMinecraftServer . maxPlayer
Return Type:
int
Gets the maximum number of players. Returns : The maximum number of players.
// MinecraftServer.maxPlayer() as int;
myMinecraftServer . maxPlayer();
Return Type:
int
Gets the modded status. // MinecraftServer.moddeStatus as string
myMinecraftServer . moddeStatus
Return Type:
string
Gets the modded status. Returns : The modded status.
// MinecraftServer.moddeStatus() as string;
myMinecraftServer . moddeStatus();
Return Type:
string
Gets the message of the day. // MinecraftServer.motd as string
Return Type:
string
Gets the message of the day. Returns : The message of the day.
// MinecraftServer.motd() as string;
myMinecraftServer . motd();
Return Type:
string
Gets the operator user permission level. // MinecraftServer.operatorUserPermissionLevel as int
myMinecraftServer . operatorUserPermissionLevel
Return Type:
int
Gets the operator user permission level. Returns : The operator user permission level.
// MinecraftServer.operatorUserPermissionLevel() as int;
myMinecraftServer . operatorUserPermissionLevel();
Return Type:
int
Gets the overworld. myMinecraftServer . overworld
Return Type:
ServerLevel
Gets the overworld. Returns : The overworld.
myMinecraftServer . overworld();
Return Type:
ServerLevel
Gets the custom data of the overworld. The overworld is always loaded, so this can be used to store and access data no matter what level a player may be in.
myMinecraftServer . overworldData
Return Type:
CraftTweakerSavedData
Gets the custom data of the overworld. The overworld is always loaded, so this can be used to store and access data no matter what level a player may be in.
Returns : The overworld's custom data.
myMinecraftServer . overworldData();
Return Type:
CraftTweakerSavedData
Gets the player count. // MinecraftServer.playerCount as int
myMinecraftServer . playerCount
Return Type:
int
Gets the player count. Returns : The player count.
// MinecraftServer.playerCount() as int;
myMinecraftServer . playerCount();
Return Type:
int
Gets the player list. myMinecraftServer . playerList
Return Type:
PlayerList
Gets the player list. Returns : The player list.
myMinecraftServer . playerList();
Return Type:
PlayerList
Gets the player names. // MinecraftServer.playerNames as string[]
myMinecraftServer . playerNames
Return Type:
string []
Gets the player names. Returns : The player names.
// MinecraftServer.playerNames() as string[];
myMinecraftServer . playerNames();
Return Type:
string []
Sends a message to the command source. // MinecraftServer.sendMessage(component as Component ); myMinecraftServer . sendMessage(myComponent);
Gets the server mod name. // MinecraftServer.serverModName as string
myMinecraftServer . serverModName
Return Type:
string
Gets the server mod name. Returns : The server mod name.
// MinecraftServer.serverModName() as string;
myMinecraftServer . serverModName();
Return Type:
string
Gets the server version. // MinecraftServer.serverVersion as string
myMinecraftServer . serverVersion
Return Type:
string
Gets the server version. Returns : The server version.
// MinecraftServer.serverVersion() as string;
myMinecraftServer . serverVersion();
Return Type:
string
Sets the default game type. // MinecraftServer.setDefaultGameType(gameType as GameType ); myMinecraftServer . setDefaultGameType(myGameType);
Sets the difficulty of the server. // MinecraftServer.setDifficulty(difficulty as Difficulty , force as bool); myMinecraftServer . setDifficulty(myDifficulty, myBool);
Parameters:
force: bool
Type: bool
- Whether to force the difficulty.
Sets if the difficulty should be locked. // MinecraftServer.setDifficultyLocked(locked as bool);
myMinecraftServer . setDifficultyLocked(myBool);
Parameters:
locked: bool
Type: bool
- Whether to lock the difficulty.
Sets if the whitelist is enforced. // MinecraftServer.setEnforceWhitelist(enforceWhitelist as bool);
myMinecraftServer . setEnforceWhitelist(myBool);
Parameters:
enforceWhitelist: bool
Type: bool
- Whether to enforce the whitelist.
Sets if flight is allowed. // MinecraftServer.setFlightAllowed(flightAllowed as bool);
myMinecraftServer . setFlightAllowed(myBool);
Parameters:
flightAllowed: bool
Type: bool
- Whether to allow flight.
Sets the message of the day. // MinecraftServer.setMotd(motd as string);
myMinecraftServer . setMotd(myString);
Parameters:
motd: string
Type: string
- The message of the day.
Sets if PvP is allowed. // MinecraftServer.setPvpAllowed(pvpAllowed as bool);
myMinecraftServer . setPvpAllowed(myBool);
Parameters:
pvpAllowed: bool
Type: bool
- Whether to allow PvP.
Checks if the commands from this source should inform admins. // MinecraftServer.shouldInformAdmins as bool
myMinecraftServer . shouldInformAdmins
Return Type:
bool
Checks if the commands from this source should inform admins. Returns : True if the commands from this source should inform admins, false otherwise.
// MinecraftServer.shouldInformAdmins() as bool;
myMinecraftServer . shouldInformAdmins();
Return Type:
bool
Gets the spawn protection radius. // MinecraftServer.spawnProtectionRadius as int
myMinecraftServer . spawnProtectionRadius
Return Type:
int
Gets the spawn protection radius. Returns : The spawn protection radius.
// MinecraftServer.spawnProtectionRadius() as int;
myMinecraftServer . spawnProtectionRadius();
Return Type:
int
Gets the tick count. // MinecraftServer.tickCount as int
myMinecraftServer . tickCount
Return Type:
int
Gets the tick count. Returns : The tick count.
// MinecraftServer.tickCount() as int;
myMinecraftServer . tickCount();
Return Type:
int