Ping both Minecraft Bedrock and Java servers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Timofey Gelazoniya e927748935
1.0.4
4 months ago
example initial commit 4 months ago
lib initial commit 4 months ago
types docs(docs): сhanged the module name according to the scope, added links to src files 4 months ago
.gitignore initial commit 4 months ago
LICENSE initial commit 4 months ago
README.md docs: сhanged the module name according to the scope 4 months ago
SECURITY.md initial commit 4 months ago
index.js initial commit 4 months ago
package.json 1.0.4 4 months ago
yarn.lock initial commit 4 months ago

README.md

mineping

Collect information about Minecraft (both Java and Bedrock) using Node.js.

Description

mineping is a Javasript library thar provides Minecraft server ping protocol implementation. It can be used to collect information about the server, such as MODT, current online, server icon (java edition only) and etc.

Requirements

Node.js 14 or newer is required

Install

npm i @minescope/mineping

Loading and configuration the module

ES Modules (ESM)

import { pingJava, pingBedrock } from '@minescope/mineping';

CommonJS

mineping is an ESM-only module — you are not able to import it with require(). If you cannot switch to ESM, you can use the async import() function from CommonJS to load mineping asynchronously:

const pingJava = (...args) => import('@minescope/mineping').then(module => module.pingJava(...args));
const pingBedrock = (...args) => import('@minescope/mineping').then(module => module.pingBedrock(...args));

Usage

Ping a Java server with default options:

import { pingJava } from '@minescope/mineping';

const data = await pingJava('mc.hypixel.net');
console.log(data);

Ping a Bedrock server with custom options:

import { pingBedrock } from '@minescope/mineping';

const data = await pingBedrock('mco.mineplex.com', {
    port: 19132,
    timeout: 500
});
console.log(data);

More complex example can be found in the example folder!

Acknowledgements

  • mcping crate for Rust
  • mcping-js library for quering Minecraft Java Edition servers