Skip to content

Repository files navigation

Minecraft on Workers

A Pumpkin Minecraft Java server, compiled from Rust to WebAssembly and hosted in a Cloudflare Durable Object. Workers accepts the TCP connection; Pumpkin runs the game; a mounted SQLite filesystem stores the world.

Minecraft Java 26.2 multiplayer alongside Wrangler running the Pumpkin server

Minecraft → Workers TCP ingress → MinecraftWorld → Pumpkin + SQLite

Try it

Linux and macOS build hosts are supported. Install Git, rustup, Python 3.11+, and Node 24+ (26 recommended). From a checkout of this repository:

bash scripts/setup.sh
npm run dev

Setup installs the pinned Rust toolchain, fetches and patches Pumpkin under .work/, and installs worker-build, which provisions Emscripten and wasm-bindgen itself. npm run dev compiles Pumpkin with worker-build --emscripten and starts Wrangler. The first build takes several minutes; later builds use Cargo's cache.

Connect Minecraft Java 26.2 to localhost:25565. Status is available at http://localhost:8787/.

The example uses offline mode with encryption disabled and fast packet compression. Local listeners bind to loopback. WORLD_NAME in wrangler.jsonc selects the Durable Object; gameplay settings such as view distance and the player limit are Worker variables.

World data lives under .data/workers/server/, written through to the Durable Object's SQLite storage as Pumpkin saves. After the last player leaves, the server saves and keeps a short reconnect window before stopping; the next connection starts it on the same world. Server-list pings do not start the runtime. Wait for status to report phase: "idle" before stopping Wrangler so the final save completes.

Build and contribute

npm run build        # Compile the Worker without starting Wrangler
npm test             # Two-player gameplay, a persistent block edit, and restart
npm run test:scheduler

The tests use separate data under .data/probes/. They verify that two clients observe the same block edit and that the edit and player position survive restart.

See development, architecture, and dependency pins for build details and patch maintenance.

Deploy

After setup, deploy the Worker; Wrangler builds the Rust runtime first:

npx wrangler deploy

The Durable Object is declared under exports in wrangler.jsonc as a SQLite-backed class. Workers TCP ingress maps a public IP and port to the Worker's connect handler; that mapping is provisioned separately and is tied to the Worker's name, so deploy under the mapped name. Players connect to the mapped ip:port. The listener in wrangler.jsonc is for local development. See memory usage for the optimizations and measurements.

Credits and license

Built on Pumpkin, workers-rs, Tokio, Emscripten, wasm-bindgen, and Guy Bedford's Rust/Emscripten work.

Licensed under GPL-3.0-only, consistent with Pumpkin. The original MIT notice is retained for inherited code. Dependencies retain their own licenses. This is an unofficial project and is not affiliated with Mojang or Microsoft.

About

No description, website, or topics provided.

Resources

Stars

21 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages