Skip to content

A NodeJS packet to get the Minecraft server list ping data

License

Notifications You must be signed in to change notification settings

Falcort/minecraft-SLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft-SLP

Description

This package sends SLP (see here) request to a minecraft server and return the result.

How to use

This package wrap the ping into a Promise, you can use it like :

import mcSLP from 'minecraft-slp';
mcSLP().then(() => {
  // Success
}, () => {
  // Error
});

Or you can use it with async/await

import mcSLP from 'minecraft-slp';

async function myFunction() {
  await mcSLP();
}

The result format in case of success is :

{
    "version": {
        "name": "1.8.7",
        "protocol": 47
    },
    "players": {
        "max": 100,
        "online": 5,
        "sample": [
            {
                "name": "thinkofdeath",
                "id": "4566e69f-c907-48ee-8d71-d7ba5aa00d20"
            }
        ]
    },
    "description": {
        "text": "Hello world"
    },
    "favicon": "data:image/png;base64,<data>"
}

Created by SOUQUET Thibault