1.1.2 • Published 3 years ago

mc-bedrock-server v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

mc-bedrock-server

This module is a wrapper for the Minecraft bedrock edition server

API

  • Default export
  • Exports

Default export

Methods

static getLatestDownloadURL(): string;
Gets the latest bedrock server download from the official Minecraft website using puppeteer. (Opens a non-headless puppeteer instance and minimizes it)

static camelcaseToDashCase(input: string): string;
Converts the input string from camel case to dash case. (Used internally, but exposed because someone might want it)

static createServerProperitesData(properties: ServerProperties): string;
Creates the data string for the server.properties file. Properties paramater is an object of camel-cased keys with values. For the ServerProperties type look in build/index.d.ts.

constructor(folder: string);
Creates a new BedrockServer instance.

initServerFolder(zipdata: Buffer, properties: ServerProperties, files: { [filename: string]: string }): void;
Creates the server in the folder specified with the constructor. Zipdata is a buffer of the zip file of the server. Properties is a ServerProperties object passed to changeServerProperties. Files is an object with the filenames as keys and the contents as values.

initServerFolder(zipurl: string, properties: ServerProperties, files: { [filename: string]: string }): Promie<void>;
Creates the server in the folder specified with the constructor. Zipurl is the url of the zip file to extract. Properties is a ServerProperties object passed to changeServerProperties. Files is an object with the filenames as keys and the contents as values.

changeServerProperties(properties: ServerProperties): void;
Changes the server.properties file. Server must be restarted after using this.

start(): import('child_process').ChildProcess;
Starts the server and returns a ChildProcess object.

stop(code: NodeJS.Signal): number;
Stops the server and returns the exit code.

properties

static server_properties_default: ServerProperties;
Default server properties.

static server_properties_data: string;
readonly folder;

Folder where the server is running. Can not be changed.
Server properties template.

proc: import('child_process').ChildProcess;
Process of the server.

Exports

ServerProperties

interface of the server properties.