Skip to main content

JNbot Proxy

JNbot Proxy sits between a Minecraft client and its server. It forwards packets unchanged unless your script handles them.

The proxy reads the Minecraft version from each client handshake. It connects to the upstream server with that version. You do not set a client version in the proxy config, and JNbot does not translate packets between protocol versions.

Start a proxy from a script​

const { Proxy } = require("JNbot");

const proxy = new Proxy({
proxyPort: 25565,
host: "play.example.net",
port: 25565,
});

proxy.on("connection", (connection) => {
console.log(`${connection.username} connected with ${connection.client.version}`);
});

Connect Minecraft to the proxy port. The proxy opens an upstream connection to host:port for that player.

Inspect and change packets​

Each connection has a packet pipeline. A handler can read, change, drop, or add packets in either direction.

proxy.on("connection", (connection) => {
connection.pipeline.on("*", (packet) => {
console.log(packet.direction, packet.name);
});
});

Read packet interception before changing live traffic. Packet names and fields depend on the active Minecraft version.

Built-in commands​

When a player uses the proxy, these commands are available in chat:

  • /jnbot status shows the upstream connection.
  • /jnbot record [name] records client-to-server packets.
  • /jnbot debug starts or stops a two-direction debug recording.
  • /jnbot replay <name> replays a recording.
  • /jnbot stop stops recording and replay.
  • /jnbot list lists recordings.

Read recording and replay for the programmatic API.