MCServer

Импорт класса

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.

import crafttweaker.api.server.MCServer;

Implemented Interfaces

MCServer implements the following interfaces. That means all methods defined in these interfaces are also available in MCServer

  • AutoCloseable

Methods

executeCommand

Runs a command.

Returns The success value of the command, or 0 if an exception occurred.

Note: Some commands' success value is 0

Return Type: int

MCServer.executeCommand(command as string) as int
ПараметрТипDescription
commandstringNo Description Provided
executeCommand

let a player send a command

Returns The success value of the command, or 0 if an exception occurred.

Note: Some commands' success value is 0

Return Type: int

MCServer.executeCommand(command as string, player as MCPlayerEntity) as int
ПараметрТипDescription
commandstringNo Description Provided
playerMCPlayerEntityNo Description Provided
getWorld

Get a server world instance based on resource location Throws an exception if the world location is unknown

Return Type: MCServerWorld

MCServer.getWorld(location as MCResourceLocation) as MCServerWorld
myMCServer.getWorld(<resource:minecraft:the_end>);
ПараметрТипDescription
местоположениеРасположение MCResource-ресурсовNo Description Provided

Свойства

НазваниеТипИмеет GetterИмеет Setter
worldsCollection<MCServerWorld>truefalse