maple-server
v0.2.2
Published
Enhance the vanilla server for Minecraft: Java Edition.
Downloads
2
Readme
MapleServer
Enhance the vanilla server for Minecraft: Java Edition.
The code for this example can be found in the examples directory.
Installation
npm install maple-server
Setup
- Edit
server.properties
like this. Enter any password inrcon.password
.
enable-rcon = true
rcon.port = 25575
rcon.password = <password>
- Create an instance of MapleServer.
Enter the value ofrcon.password
inpassword
and the path to the server directory indirectoryPath
.
Inargs
enter the command options and arguments to start the server.
const { MapleServer } = require('maple-server');
const server = new MapleServer({
rconClient: {
host: 'localhost',
port: 25575,
password: <password>,
},
server: {
directoryPath: <path>,
},
});
const args = ['-Xmx2G', '-Xms2G', '-jar', 'server.jar'];
server.start(args);
- Run it, and if the Minecraft server starts successfully, the setup is complete.
Events
The MapleServer
class has these events:
playerChat
Called when a player sends a chat. | Parameter | Type | Description | | :-: | :-: | :-: | | sender | MaplePlayer[] | The chat sender | | message | string | The message sent |
playerQuit
Called when a player leaves a server. | Parameter | Type | Description | | :-: | :-: | :-: | | player | MaplePlayer[] | Player who left the server |
playerJoin
Called when a player joins a server. | Parameter | Type | Description | | :-: | :-: | :-: | | player | MaplePlayer[] | Player who joined the server |
serverStop
Called when a server is stopped.
serverStart
Called when a server starts.
ready
Called when a server is ready.