mcping-js
A modern JavaScript library for querying Minecraft Java Edition servers using the vanilla Server List Ping protocol.
Usage
const mcping = // 25565 is the default Minecraft Java Edition multiplayer server port// The port may be omitted and will default to 25565const server = 'mc.hypixel.net' 25565 server
protocolVersion
is ever changing as Minecraft updates. See protocol version numbers for a complete and updated listing.
If successful, res
will be a parsed copy of the Response packet.
Compatibility
- This does not support Minecraft's legacy ping protocol for pre-Minecraft version 1.6 servers.
- This does not support the
Ping
orPong
behavior of the Server List Ping protocol. If you wish to determine the latency of the connection do you should do so manually.