A Node library that parses and serializes Minecraft PC protocol packets, with client and server helpers for login, encryption, compression, and status.
Overview
node-minecraft-protocol is a Node module for working with the Minecraft Java Edition network protocol. It handles parsing incoming packets into JavaScript objects and building outbound packets from plain object fields, including authentication and encryption steps used on real servers.
On the client side, the library covers logging in, encryption, compression, online and offline authentication modes, keep-alive handling, SRV DNS lookups, server status pings, and connecting to Realms with Microsoft sign-in when configured. Tokens can be cached under a profiles folder or the user’s .minecraft directory.
Server usage includes online and offline modes, handshake, encryption, compression, keep-alive checks, and ping status responses. The source lists broad Minecraft PC protocol version coverage and describes the design as pluggable, with third-party extensions such as Forge protocol support.
Typical use is installing the package via npm and requiring it in scripts that act as bots, proxies, packet debuggers, or custom servers. Examples in the source show echo clients, Realm joins, and minimal “hello world” servers. Debugging can be enabled with a DEBUG environment variable; Windows-specific notes appear for that setting.
Key features
- Parse and emit Minecraft packets as objects
- Client login with online and offline auth
- Microsoft authentication and token caching
- Create Minecraft protocol servers
- SRV records and server status ping
- Realm connection support
- Pluggable architecture for extensions
- Wide Minecraft PC version support
Use cases
- Custom Minecraft bots and automation
- Protocol proxies and packet tooling
- Standalone lightweight game servers
- Debugging and monitoring Minecraft traffic