Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.54 KB

README.md

File metadata and controls

58 lines (47 loc) · 1.54 KB

queryserver

This package is a tool for the Minecraft server protocol that allows the user to query the status of a Minecraft server (be it Java Edition, Bedrock Edition, MCPE, and more) using wide berth of protocols and data-merging techniques.

This package is the successor to QueryServer.js v3 library used by the Minecraft Server Status Discord bot.

Todo items:

  • Support for nonstandard implementations (GeyserMC, etc.)
  • Legacy (beta/alpha) server support
  • Fix dangling promises/event loop hogging
  • Performance improvements

NOTE: This project is still WIP

Function signature:

interface QueryServerResults {
  hostname?: string;
  ip: string;

  type: "Java" | "Bedrock" | "Unknown" | "Crossplay";

  motd?: string;
  version?: string;
  players: {
      online?: number;
      max?: number;
      list?: string[];
  };
  favicon?: string;
  latency: number;

  debug: {
    options: Options;
    srvs?: string[];

    protocol?: number;
    protocolVersion?: string;

    java: boolean;
    bedrock: boolean;
    query: boolean;
  };
}

declare function queryserver(host: string, options: Options): Promise<QueryServerResults>;

Install instructions:

  1. Run npm install --save queryserver
  2. Use as follows:
   import queryserver from "queryserver";
   // or...
   const queryserver = require("queryserver").default;

   queryserver("mc.hypixel.net:25565")
     .then(console.dir)
     .catch(console.error);