1.1.0 • Published 2 months ago
minecraft-server-info v1.1.0
minecraft-server-info
This project is a simple Node.js module that allows you to check the status of Minecraft servers.
Installation
To install this module, use the following command:
npm install --save minecraft-server-info
Usage example
Below is an example of how to check the status of a Minecraft server:
const mc = require('minecraft-server-info');
mc.status({ type: 'java', ip: 'hypixel.net', port: 25565, show: ['online', 'players.online'], }) .then((res) => console.log(res)) .catch((err) => console.log(err));
In the above example the status
function will be called with a configuration object that specifies the type
of the server (java
or bedrock
), the ip
of the server, the port
of the server and the show
array that specifies which fields should be shown in the result.
But you can also display for example only the number of players via:
console.log(res['players.online'])
Available fields
Possible fields to display are:
online
: whether the server is onlineplayers.online
: the number of players onlineplayers.max
: the maximum number of players that can connect at the same timefavicon
: a link to the server icon
...and many others, it all depends on what the Minecraft server returns.