Server
Importing the class
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;
Extends
Server extends ReentrantBlockableEventLoop<TickTask>
.
Implements
Server
implements the following interfaces:
Undocumented Interfaces
ServerInfo
,ChunkIOErrorReporter
,ProfilerMeasured
,ProcessorHandle<Runnable>
,Executor
Members
// MinecraftServer.absoluteMaxWorldSize as intmyMinecraftServer.absoluteMaxWorldSize
Return Type:
int
Returns: The absolute maximum world size.
// MinecraftServer.absoluteMaxWorldSize() as int;myMinecraftServer.absoluteMaxWorldSize();
Return Type:
int
// MinecraftServer.acceptsFailure as boolmyMinecraftServer.acceptsFailure
Return Type:
bool
Returns: True if the commands from this source should return failure messages, false otherwise.
// MinecraftServer.acceptsFailure() as bool;myMinecraftServer.acceptsFailure();
Return Type:
bool
// MinecraftServer.acceptsSuccess as boolmyMinecraftServer.acceptsSuccess
Return Type:
bool
Returns: True if the commands from this source should return successful messages, false otherwise.
// MinecraftServer.acceptsSuccess() as bool;myMinecraftServer.acceptsSuccess();
Return Type:
bool
// MinecraftServer.advancements as ServerAdvancementManagermyMinecraftServer.advancements
Return Type:
ServerAdvancementManager
Returns: All levels.
myMinecraftServer.allLevels();
Return Type:
Iterable<ServerLevel>
// MinecraftServer.alwaysAccepts as boolmyMinecraftServer.alwaysAccepts
Return Type:
bool
Returns: True if the command source always accepts, false otherwise.
// MinecraftServer.alwaysAccepts() as bool;myMinecraftServer.alwaysAccepts();
Return Type:
bool
// MinecraftServer.areNpcsEnabled as boolmyMinecraftServer.areNpcsEnabled
Return Type:
bool
Returns: True if NPCs are enabled, false otherwise.
// MinecraftServer.areNpcsEnabled() as bool;myMinecraftServer.areNpcsEnabled();
Return Type:
bool
// MinecraftServer.currentSmoothedTickTime as floatmyMinecraftServer.currentSmoothedTickTime
Return Type:
float
Returns: The current smoothed tick time.
// MinecraftServer.currentSmoothedTickTime() as float;myMinecraftServer.currentSmoothedTickTime();
Return Type:
float
// 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
myMinecraftServer.executeCommand("time set day", player, true);
Returns: The level.
myMinecraftServer.getLevel(myResourceLocation);
Parameters:
Return Type:
ServerLevel
Returns: The spawn radius.
myMinecraftServer.getSpawnRadius(myServerLevel);
Parameters:
Return Type:
int
// MinecraftServer.isCommandBlockEnabled as boolmyMinecraftServer.isCommandBlockEnabled
Return Type:
bool
Returns: True if command blocks are enabled, false otherwise.
// MinecraftServer.isCommandBlockEnabled() as bool;myMinecraftServer.isCommandBlockEnabled();
Return Type:
bool
// MinecraftServer.isDedicatedServer as boolmyMinecraftServer.isDedicatedServer
Return Type:
bool
Returns: True if the server is dedicated, false otherwise.
// MinecraftServer.isDedicatedServer() as bool;myMinecraftServer.isDedicatedServer();
Return Type:
bool
// MinecraftServer.isEnforceWhitelist as boolmyMinecraftServer.isEnforceWhitelist
Return Type:
bool
Returns: True if the whitelist is enforced, false otherwise.
// MinecraftServer.isEnforceWhitelist() as bool;myMinecraftServer.isEnforceWhitelist();
Return Type:
bool
// MinecraftServer.isFlightAllowed as boolmyMinecraftServer.isFlightAllowed
Return Type:
bool
Returns: True if flight is allowed, false otherwise.
// MinecraftServer.isFlightAllowed() as bool;myMinecraftServer.isFlightAllowed();
Return Type:
bool
// MinecraftServer.isHardcore as boolmyMinecraftServer.isHardcore
Return Type:
bool
Returns: True if the server is hardcore, false otherwise.
// MinecraftServer.isHardcore() as bool;myMinecraftServer.isHardcore();
Return Type:
bool
// MinecraftServer.isPvpAllowed as boolmyMinecraftServer.isPvpAllowed
Return Type:
bool
Returns: True if PvP is allowed, false otherwise.
// MinecraftServer.isPvpAllowed() as bool;myMinecraftServer.isPvpAllowed();
Return Type:
bool
// MinecraftServer.isReady as boolmyMinecraftServer.isReady
Return Type:
bool
Returns: True if the server is ready, false otherwise.
// MinecraftServer.isReady() as bool;myMinecraftServer.isReady();
Return Type:
bool
// MinecraftServer.isRunning as boolmyMinecraftServer.isRunning
Return Type:
bool
Returns: True if the server is running, false otherwise.
// MinecraftServer.isRunning() as bool;myMinecraftServer.isRunning();
Return Type:
bool
// MinecraftServer.isShutdown as boolmyMinecraftServer.isShutdown
Return Type:
bool
Returns: True if the server is shutting down, false otherwise.
// MinecraftServer.isShutdown() as bool;myMinecraftServer.isShutdown();
Return Type:
bool
// MinecraftServer.isSingleplayer as boolmyMinecraftServer.isSingleplayer
Return Type:
bool
Returns: True if the server is singleplayer, false otherwise.
// MinecraftServer.isSingleplayer() as bool;myMinecraftServer.isSingleplayer();
Return Type:
bool
// MinecraftServer.isSpawningAnimals as boolmyMinecraftServer.isSpawningAnimals
Return Type:
bool
Returns: True if animals are spawning, false otherwise.
// MinecraftServer.isSpawningAnimals() as bool;myMinecraftServer.isSpawningAnimals();
Return Type:
bool
// MinecraftServer.isSpawningMonsters as boolmyMinecraftServer.isSpawningMonsters
Return Type:
bool
Returns: True if monsters are spawning, false otherwise.
// MinecraftServer.isSpawningMonsters() as bool;myMinecraftServer.isSpawningMonsters();
Return Type:
bool
// MinecraftServer.isStopped as boolmyMinecraftServer.isStopped
Return Type:
bool
Returns: True if the server is stopped, false otherwise.
// MinecraftServer.isStopped() as bool;myMinecraftServer.isStopped();
Return Type:
bool
Returns: True if the position is under spawn protection, false otherwise.
// MinecraftServer.isUnderSpawnProtection(level as ServerLevel, pos as BlockPos, player as Player) as bool;myMinecraftServer.isUnderSpawnProtection(myServerLevel, myBlockPos, myPlayer);
Parameters:
Return Type:
bool
myMinecraftServer.levelKeys
Return Type:
List<ResourceLocation>
Returns: The keys of all levels.
myMinecraftServer.levelKeys();
Return Type:
List<ResourceLocation>
// MinecraftServer.maxPlayer as intmyMinecraftServer.maxPlayer
Return Type:
int
Returns: The maximum number of players.
// MinecraftServer.maxPlayer() as int;myMinecraftServer.maxPlayer();
Return Type:
int
// MinecraftServer.moddeStatus as stringmyMinecraftServer.moddeStatus
Return Type:
string
Returns: The modded status.
// MinecraftServer.moddeStatus() as string;myMinecraftServer.moddeStatus();
Return Type:
string
// MinecraftServer.motd as stringmyMinecraftServer.motd
Return Type:
string
Returns: The message of the day.
// MinecraftServer.motd() as string;myMinecraftServer.motd();
Return Type:
string
// MinecraftServer.operatorUserPermissionLevel as intmyMinecraftServer.operatorUserPermissionLevel
Return Type:
int
Returns: The operator user permission level.
// MinecraftServer.operatorUserPermissionLevel() as int;myMinecraftServer.operatorUserPermissionLevel();
Return Type:
int
// MinecraftServer.overworld as ServerLevelmyMinecraftServer.overworld
Return Type:
ServerLevel
Returns: The overworld.
myMinecraftServer.overworld();
Return Type:
ServerLevel
The overworld is always loaded, so this can be used to store and access data no matter what level a player may be in.
// MinecraftServer.overworldData as CraftTweakerSavedDatamyMinecraftServer.overworldData
Return Type:
CraftTweakerSavedData
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
// MinecraftServer.playerCount as intmyMinecraftServer.playerCount
Return Type:
int
Returns: The player count.
// MinecraftServer.playerCount() as int;myMinecraftServer.playerCount();
Return Type:
int
// MinecraftServer.playerList as PlayerListmyMinecraftServer.playerList
Return Type:
PlayerList
Returns: The player list.
myMinecraftServer.playerList();
Return Type:
PlayerList
// MinecraftServer.playerNames as string[]myMinecraftServer.playerNames
Return Type:
string[]
Returns: The player names.
// MinecraftServer.playerNames() as string[];myMinecraftServer.playerNames();
Return Type:
string[]
// MinecraftServer.serverModName as stringmyMinecraftServer.serverModName
Return Type:
string
Returns: The server mod name.
// MinecraftServer.serverModName() as string;myMinecraftServer.serverModName();
Return Type:
string
// MinecraftServer.serverVersion as stringmyMinecraftServer.serverVersion
Return Type:
string
Returns: The server version.
// MinecraftServer.serverVersion() as string;myMinecraftServer.serverVersion();
Return Type:
string
myMinecraftServer.setDifficulty(myDifficulty, myBool);
Parameters:
force: bool
Type: bool
- Whether to force the difficulty. // MinecraftServer.setDifficultyLocked(locked as bool);myMinecraftServer.setDifficultyLocked(myBool);
Parameters:
locked: bool
Type: bool
- Whether to lock the difficulty. // MinecraftServer.setEnforceWhitelist(enforceWhitelist as bool);myMinecraftServer.setEnforceWhitelist(myBool);
Parameters:
enforceWhitelist: bool
Type: bool
- Whether to enforce the whitelist. // MinecraftServer.setFlightAllowed(flightAllowed as bool);myMinecraftServer.setFlightAllowed(myBool);
Parameters:
flightAllowed: bool
Type: bool
- Whether to allow flight. // MinecraftServer.setMotd(motd as string);myMinecraftServer.setMotd(myString);
Parameters:
motd: string
Type: string
- The message of the day. // MinecraftServer.setPvpAllowed(pvpAllowed as bool);myMinecraftServer.setPvpAllowed(myBool);
Parameters:
pvpAllowed: bool
Type: bool
- Whether to allow PvP. // MinecraftServer.shouldInformAdmins as boolmyMinecraftServer.shouldInformAdmins
Return Type:
bool
Returns: True if the commands from this source should inform admins, false otherwise.
// MinecraftServer.shouldInformAdmins() as bool;myMinecraftServer.shouldInformAdmins();
Return Type:
bool
// MinecraftServer.spawnProtectionRadius as intmyMinecraftServer.spawnProtectionRadius
Return Type:
int
Returns: The spawn protection radius.
// MinecraftServer.spawnProtectionRadius() as int;myMinecraftServer.spawnProtectionRadius();
Return Type:
int
// MinecraftServer.tickCount as intmyMinecraftServer.tickCount
Return Type:
int
Returns: The tick count.
// MinecraftServer.tickCount() as int;myMinecraftServer.tickCount();
Return Type:
int