minecraft-server-info

1.1.0 • Public • Published

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 online
  • players.online: the number of players online
  • players.max: the maximum number of players that can connect at the same time
  • favicon: a link to the server icon

...and many others, it all depends on what the Minecraft server returns.

Package Sidebar

Install

npm i minecraft-server-info

Weekly Downloads

5

Version

1.1.0

License

ISC

Unpacked Size

3.2 kB

Total Files

4

Last publish

Collaborators

  • adix