# Change the platform version

> Move a Minekube project to another Paper or Velocity version on purpose - edit vite.config.ts, regenerate the types with mk types, let the type check show what broke, restart the dev server, and deploy with a check of the servers' versions.

A project builds for the [platform version](https://minekube.com/games/concepts/platform-version) its `vite.config.ts` names. `mk init` writes the newest stable one when it creates the project, and nothing changes it after that. To move to another version, change it yourself.

## 1. Pick the version

Find the version on PaperMC's downloads page for [Paper](https://papermc.io/downloads/paper) or [Velocity](https://papermc.io/downloads/velocity), and write it into `vite.config.ts`:

```ts title="vite.config.ts" {4}
minekube({
  bundles: { arena: { platform: "paper", entry: "src/game.ts" } },
  // Was "1.21.8".
  paper: { version: "26.3" },
});
```

Add `build` to pin one build of it, such as `build: 273`. Without it, `mk` takes the newest stable build.

A new project can start on any version: `mk init --paper 1.21.8 my-game`, and `--velocity 4.3.1` with `--proxy`.

## 2. Generate the types

```sh
mk types
```

`mk types` downloads that build from PaperMC once and generates `types/paper` from its jars, without a server. It needs no network for a build it generated before. `mk dev` does the same before it builds, so this step is also what happens on the next `mk dev .`.

## 3. Let the type check show what broke

```sh
bun run check
```

Every call into an API the new version changed or removed is a type error now, before any player sees it. Fix them, then run your tests: `bun test`.

## 4. Run the dev server on the new version

Stop `mk server` and start it again in the project folder. It downloads the version the project names and upgrades the world on start. `mk dev .` warns while the dev server still runs another version:

```txt
The dev server last started with Paper 1.21.8 build 60, vite.config.ts names 26.3: start `mk server` again in the project to run it.
```

## 5. Deploy

`mk deploy` lists the servers of the target that run another version than the bundles are built for, by the registry's `minekube.com/version` label, and deploys anyway:

```txt
Warning: A server of prod (every server in play) runs another platform version than the bundles were built for:
  3f9c2a1b7d4e  online   paper 1.21.8: arena is built for 26.3
They get the bundles anyway and their connectors warn; --strict-versions refuses instead.
```

Update those servers, or deploy with `--strict-versions` (or `strictVersions: true` on the target) to refuse while any server runs another version. `mk versions list` shows each bundle with the version it was built for.

## Related

- [Platform version](https://minekube.com/games/concepts/platform-version): what the version decides, and why it is per platform.
- [Deploy a version](https://minekube.com/games/versions-and-deployments/deploy): the first deploy.
- [Supported platforms](https://minekube.com/games/platform/supported-platforms): the Paper and Velocity versions the Minekube plugin runs on.
