minecraft-slp
v0.2.1
Published
A NodeJS packet to get the Minecraft server list ping data
Downloads
11
Readme
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>"
}