# Quick start

> Create a Minekube game, run it on a local Paper dev server, change it while you play, and watch every message in the devtools.

Create a project, start the dev server, and play your game. Then change it and save: the server swaps it while you stay connected.

You need [Bun](https://bun.sh) 1.4.4 or newer and Minecraft: Java Edition 26.3. The CLI downloads the Java it runs servers on, a GraalVM JDK that JIT-compiles game code, and keeps it with the dev servers and its other downloads in `~/.minekube` (`MINEKUBE_HOME` moves it).

## Create a project

Install the Minekube CLI once. It is `minekube`, `mk` for short, and this puts both on your PATH. Then create a project:

```sh
bun add -g https://github.com/minekube/minekube/releases/latest/download/minekube-cli.tgz
mk init my-game
cd my-game
```

`my-game` holds a small game (each block you place scores a point), its tests, an `AGENTS.md` and the `minekube-games` skill for your coding agent. Its `vite.config.ts` names the game's bundle after the folder: `my-game` is the game's id on the server. [Game structure](https://minekube.com/games/write/game-structure) explains every file.

## Start the dev server

Start the server in its own terminal and keep it running:

```sh
mk server --accept-eula
```

It runs Paper on `localhost:25569` with the Minekube plugin: a flat creative world in offline mode, and the Effect UI devtools on `127.0.0.1:4774`. `--accept-eula` accepts the [Minecraft EULA](https://aka.ms/MinecraftEULA) for the new server, so pass it only if you agree. Use one dev server for all your games.

## Install your game

In a second terminal, in `my-game`:

```sh
mk dev .
```

`mk init` already generated the Paper types of the version `vite.config.ts` names into `types/paper`, and `mk dev` brings them up to date first. Then it builds the bundle `vite.config.ts` names, `src/game.ts`, with Vite, installs it on the dev server and reinstalls it on every save. The server log says `Installed my-game` with the revision, the first 8 hex digits of the bundle's SHA-256.

## Join and play

In Minecraft, choose **Multiplayer**, then **Direct Connection**, and join `localhost:25569`. Place a block: the action bar shows `Score: 1`, then `Score: 2`.

To see the runtime's messages in chat, prefixed `[games]`, make yourself an operator: type `op <your name>` in the `mk server` terminal.

## Change it while you play

Open `src/game.ts`, change `NamedTextColor.GOLD` to `NamedTextColor.AQUA` and save. Within a tick or two the chat says `Reloaded my-game` with the new revision, and your next score shows in aqua. You never left the server.

> Scene: You (alex) and sam play on your dev server; the Minecraft window is yours. sam asks for an aqua score; you change NamedTextColor.GOLD to AQUA in src/game.ts and save. mk dev installs the new bundle, the chat says "[games] Reloaded my-game (5d2e7b18)", nobody is disconnected, and your next score shows in aqua, starting over at 1 because a new revision starts from init.

A new revision starts with a fresh Model from `init`, so the scores start over. The world keeps its blocks. A bundle that fails to load never replaces the running one: you see `bundle rejected, keeping the previous revision` and the error.

## Watch it in the devtools

Open [http://127.0.0.1:4774](http://127.0.0.1:4774). It shows the running session live: every message, the Commands it issued, why it happened and how the Model changed. Your coding agent reads the same through MCP, configured in the project's `.mcp.json`. See [Devtools and message logs](https://minekube.com/games/testing/devtools).

## Keep the session as a test

Every revision records its messages on the server, in `plugins/Minekube/recordings/my-game/`. Copy one into your project's `recordings/` folder, then run:

```sh
bun test
bun run check
```

`bun test` runs the rules' Stories and replays every recording through your current rules. `bun run check` type-checks and lints with Effect's strict rules. [Testing](https://minekube.com/games/testing/) covers both.

## Next steps

- [Build your first game](https://minekube.com/games/get-started/first-game): write a game from its two halves, step by step.
- [Build with a coding agent](https://minekube.com/games/get-started/coding-agent): hand the project to your agent.
- [Game structure](https://minekube.com/games/write/game-structure): the rules and the server half, Commands, events, and what survives a reload.
- [Paper from TypeScript](https://minekube.com/games/write/paper-api): classes, null, numbers, exceptions and threads at the Java boundary.
- [Proxy bundles](https://minekube.com/games/write/proxy-bundles): program the Velocity proxy in front of your servers the same way.
