msmpjs
v1.0.1
Published
A Node.js TypeScript WebSocket API wrapper for the Minecraft Server Management Protocol (MSMP)
Readme
msmpjs
A basic Node.js TypeScript API wrapper for interacting with the Minecraft Server Management Protocol (MSMP) using ES modules.
Installation
Make sure npm is installed on your system and run the following:
$ npm i msmpjsExample usage
import { Client } from 'msmpjs';
const ADDRESS = 'ws://example.com';
const SECRET = 'EXAMPLE';
const server = new Client(ADDRESS, SECRET);
server.on('ready', async () => {
console.log('Connected to server');
const motd = await server.serverSettings.getMotd();
console.log(motd);
const allowList = await server.allowlist.addPlayers('Player');
allowList.forEach(player => console.log(player.name));
});
server.on("playerjoined", player => {
console.log("Player joined: ", player.name);
});
server.on('disconnected', () => console.log('Disconnected from server'));Docs
You can find detailed typedoc documentation here.
