PrismarineJS node-minecraft-protocol for Minecraft Protocol Applications
Parse and serialize minecraft packets, plus authentication and encryption.
At a glance
- What is it?
- PrismarineJS node-minecraft-protocol is a JavaScript library for parsing and serializing Minecraft packets, with client, server, authentication, encryption, compression, and protocol-version support. It suits bot, proxy, server, and packet-processing projects that need direct access to the Minecraft protocol rather than a high-level game API.
- Who is it for?
- Adopt node-minecraft-protocol when your project needs direct Minecraft packet access, protocol-version handling, or a client or server foundation in Node.js. Do not choose it when you need a complete bot framework or game server, since those higher-level responsibilities belong to projects such as mineflayer or flying-squid.
- Can I use it commercially?
- Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 17 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why node-minecraft-protocol Exists for Minecraft Automation
PrismarineJS node-minecraft-protocol addresses the low-level gap between JavaScript programs and Minecraft's network protocol. It parses incoming packets into JavaScript objects and serializes JavaScript objects into packets for transmission. The README describes support for client authentication, encryption, compression, online and offline modes, keep-alive handling, SRV lookup, and server status pings. On the server side, it covers handshakes, login, encryption, compression, keep-alive checks, and status responses.
The intended users are developers building protocol-aware clients, bots, proxies, servers, packet monitors, or custom integrations. The library is not a full gameplay environment. It does not provide a complete bot API, world simulation, entity model, or server implementation. The README instead points to related projects for those layers, including mineflayer for bots and flying-squid for server creation. That boundary matters when selecting the dependency. node-minecraft-protocol is useful when packet names, fields, protocol versions, and connection state are part of the application design.
The Packet Parsing and Serialization Flow
The package exposes client and server constructors through its main entry point, `src/index.js`, with TypeScript declarations at `src/index.d.ts`. Its dependencies include `protodef`, `minecraft-data`, `prismarine-nbt`, `prismarine-chat`, and authentication-related packages. Based on the repository layout and package metadata, protocol definitions and Minecraft version data are separated from connection handling, while packet parsing and serialization are handled by the protocol layer.
For a client, the normal path begins with `mc.createClient({ ... })`. The connection establishes the handshake and login process, then exposes packet events such as `playerChat`. Packet fields arrive as JavaScript objects, so application code can inspect fields instead of manually decoding binary buffers. The reverse path accepts JavaScript objects and uses the selected protocol definition to serialize them for sending.
Authentication and encryption are part of this connection flow rather than optional conveniences added by the README. Microsoft authentication can use a browser login and cache tokens under the selected username. Password-based authentication is documented, but the README warns that it may be unreliable. Offline mode is available for servers configured without online authentication. The protocol version is selected automatically by default, although callers can set an explicit version when required.
Installing the Package and Creating a Client
The README gives the package installation command. The package metadata specifies Node.js `>=22`, so a matching Node.js runtime is required before installation.
Install the library with:
npm install minecraft-protocolThe README's echo client example creates a client with a host, port, username, and optional version or password settings. For a server running locally in offline mode, the relevant configuration is `auth: 'offline'`, as explained by the README. The following is a direct excerpt of the documented client setup:
const mc = require('minecraft-protocol');
const client = mc.createClient({
host: "localhost",
port: 25565,
username: 'Bot',
});With this configuration, the client targets `localhost` on port `25565` and joins as `Bot`. The README states that SRV records are consulted only when the port is unspecified or set to `25565` and the host is a valid non-local domain name, so a local hostname will not use that lookup path. For Microsoft authentication, omit the offline setting, set `auth` to `microsoft`, and follow the documented browser sign-in flow.
A first useful server-side test can use the README's `createServer` example. It creates a server with `online-mode` and `encryption` enabled, binds to `0.0.0.0` on port `25565`, and selects version `1.18`. The server example then handles `playerJoin`. A real deployment should confirm that the selected version matches the protocol version of the clients and that account credentials are available for the chosen authentication mode.
Version Coverage, Extensions, and Operational Boundaries
The README lists support for a wide range of Minecraft versions, including releases and snapshots from 1.7.10 through 1.20.6, several 1.21 releases, and 26.1. This breadth is a practical advantage for projects that need to address more than one server generation, but the list is not the same as a guarantee that every feature behaves identically across versions. The package metadata points to `minecraft-data` as a dependency, indicating that version-specific data is part of the implementation rather than a single universal packet schema.
The project also advertises a plugin-style architecture. The README specifically lists `minecraft-protocol-forge`, which adds Forge support. That distinction is important: vanilla protocol support should not be interpreted as built-in support for every server modification or every protocol extension. Similarly, Microsoft authentication, Realm joining, custom authentication, custom channels, proxying, and packet debugging are represented by examples or related projects, not necessarily as one built-in high-level application model.
The package supports JavaScript packet events and packet writing, but application authors still need to understand version-specific packet names and fields. For example, chat handling differs across Minecraft generations, as shown by the README's conditional use of `formattedMessage`, `unsignedChat`, and `plainMessage`. A packet-driven project therefore needs to account for schema changes when upgrading versions.
When node-minecraft-protocol Is the Wrong Tool
The main wrong-tool case is choosing this package for a complete Minecraft bot or server product without adding the missing gameplay and operational layers. The README positions mineflayer as a higher-level bot API and flying-squid as a server framework. If the requirement is to spawn a player, navigate the world, manage entities, or provide a full server environment, this package alone does not promise those capabilities.
Authentication also introduces constraints. Offline mode is appropriate only when the server uses that mode. Microsoft mode requires a browser sign-in flow and token storage, while password-based authentication is described as potentially unreliable. A project that requires deterministic multi-account authentication, but does not yet understand token caching and account selection, should treat the authentication setup as an explicit design requirement rather than assume a username alone is sufficient.
Another boundary is protocol scope. The library can parse and serialize packets, but packet access does not automatically make an application safe or correct. Invalid field combinations, incompatible client versions, unsupported server modifications, or assumptions about chat data can still cause failures. The README does not document a general rollback procedure, a compatibility matrix for every plugin, or a promise that a packet interceptor can transparently preserve every server behavior.
Maintenance Signals, Licensing, and Upgrade Work
The repository is not archived. Its last push was on 2026-10-06, and the maintenance facts do not indicate an abandoned repository. Recent releases listed include 1.68.0 on 2026-08-27, 1.67.0 on 2026-08-16, and 1.66.2 on 2026-05-13. Those dates show recent release activity, but they do not by themselves establish compatibility with every Minecraft version or plugin.
The package is licensed under BSD-3-Clause. The repository includes a LICENSE file, and the `package.json` metadata identifies the same license. The license should be reviewed for the obligations that apply to a particular distribution or integration, but this review does not provide legal advice. The package also has development tooling in `package.json`, including `npm test`, `npm run lint`, and `npm run fix`. Those scripts indicate a defined local validation workflow, although they do not replace testing against the actual server and version an application will use.
Upgrades can require more than changing an npm version. Because protocol data is version-specific, applications should check packet event names and field shapes after upgrading, especially around chat, authentication, compression, and custom channels. The README's explicit version option is useful when automatic detection selects the wrong protocol, but it also means callers must keep that version choice synchronized with their target server.
Editorial conclusion
Adopt node-minecraft-protocol when your project needs direct Minecraft packet access, protocol-version handling, or a client or server foundation in Node.js. Do not choose it when you need a complete bot framework or game server, since those higher-level responsibilities belong to projects such as mineflayer or flying-squid. Verify first that the required Minecraft version is listed, that Node.js 22 or later is available, and that the authentication mode matches the server before depending on it in production.
Frequently asked questions
How do I install node-minecraft-protocol?
The README documents installing the package with `npm install minecraft-protocol`. The package metadata requires Node.js `>=22`.
How does node-minecraft-protocol authenticate a Minecraft client?
The README describes offline authentication for offline-mode servers and Microsoft authentication through a browser login flow. Microsoft tokens are cached under the specified username, either in the user's `.minecraft` folder or in `profilesFolder` when configured.
Does node-minecraft-protocol provide a complete Minecraft bot framework?
No. It provides packet parsing and serialization plus client and server connection features. The README identifies mineflayer as a higher-level project for creating bots, so node-minecraft-protocol is the lower-level foundation.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/prismarinejs-node-minecraft-protocol)Was this useful?