Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.
/ mcping-js Public archive

A modern JavaScript library for querying Minecraft Java Edition servers.

License

Notifications You must be signed in to change notification settings

Cryptkeeper/mcping-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcping-js

A modern JavaScript library for querying Minecraft Java Edition servers using the vanilla Server List Ping protocol.

Usage

const mcping = require('mcping-js')

// 25565 is the default Minecraft Java Edition multiplayer server port
// The port may be omitted and will default to 25565
const server = new mcping.MinecraftServer('mc.hypixel.net', 25565)

server.ping(timeout, protocolVersion, (err, res) => {
	// ...
})

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

  1. This does not support Minecraft's legacy ping protocol for pre-Minecraft version 1.6 servers.
  2. This does not support the Ping or Pong behavior of the Server List Ping protocol. If you wish to determine the latency of the connection do you should do so manually.

About

A modern JavaScript library for querying Minecraft Java Edition servers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published