# Platform version

> A Minekube project names the Paper and Velocity versions its bundles are built for, like a Cloudflare compatibility date: mk generates the project's types from that version's own jars, the dev server runs it, every build records it, and mk deploy warns about servers that run another.

A project names the version of each platform its bundles run on, in `vite.config.ts`: `paper: { version: "26.3" }` for its games, `velocity: { version: "4.3.1" }` for its proxy bundles. It works like a [Cloudflare compatibility date](https://developers.cloudflare.com/workers/configuration/compatibility-dates/): the code says which API it was written against, and nothing changes under it until you change that line.

## What the version decides

- **The types.** `mk types` (and `mk dev` first) downloads exactly that build from PaperMC and generates `types/paper` and `types/velocity` from its own jars, with the generator the [Minekube plugin](https://minekube.com/games/concepts/runtime) uses on a running server. A game sees the API of that version: its classes, overloads and nullability, nothing newer.
- **Other plugins' APIs.** `plugins: ["net.luckperms:api:5.5"]` next to the version adds the API of another plugin on the server to the same types, from its API jar on Maven. See [Other plugins' APIs](https://minekube.com/games/write/paper-api#other-plugins-apis).
- **The dev server.** `mk server`, started in the project folder, runs that version, so what the types promise is what the server has.
- **Each build.** `dist/minekube.json` records every bundle with its platform and version, and the Minekube API keeps it with the [version](https://minekube.com/games/concepts/versions-and-deployments) you deploy.
- **Deploys.** `mk deploy` compares it with the version each server of the target runs, which the registry knows as the label `minekube.com/version`, and lists the servers that run another one.

## The format

The version is the one PaperMC uses on its downloads page: Paper's Minecraft version (`26.3`, `1.21.8`) and Velocity's own (`4.3.1`, `3.4.0-SNAPSHOT`). Without a build, it is the newest stable build of that version. `build` pins one, as `paper-26.3-273.jar` names it:

```ts
paper: { version: "26.3", build: 273 },
```

## Why per platform, not per bundle

All Paper bundles of a project share one `types/paper`, run on the one dev server, and deploy as one version to the same servers. A version per bundle would let two of them disagree about the one server they share, so the version belongs to the platform, once per project. Bundles that need different Paper versions are different projects.

## Why a warning, not a refusal

A bundle built for one Paper version usually runs on the next: Paper rarely removes API. A network that updates its servers one at a time also has two versions side by side for a while, and still needs to deploy. So `mk deploy` (and `mk versions deploy` and `mk rollback`, for a version of any age) deploys and lists the servers that run another version, and the connector of such a server installs the bundle with a warning in its log. `--strict-versions`, or `strictVersions: true` on a target, refuses instead.

## Where the types come from

Nothing of Paper's or Velocity's API ships with Minekube. `mk` downloads a build once into the Minekube home (`~/.minekube`), checked by the SHA-256 PaperMC publishes, then and on every later use. For Paper it lets Paper's own launcher fetch and patch the Minecraft server and its libraries, exactly as a server starts. It generates the types once per build into `~/.minekube/types/<platform>/<version>-<build>`, shared by every project, and copies them into the project. A server of the same build writes the same types at start, byte for byte.

## Related

- [Change the platform version](https://minekube.com/games/versions-and-deployments/platform-version): update a project, step by step.
- [Vite plugin and configuration](https://minekube.com/games/versions-and-deployments/vite-plugin): every field of `minekube()`.
- [Paper from TypeScript](https://minekube.com/games/write/paper-api): how a game calls the API the types describe.
