# Bundles

> A bundle is one JavaScript file that a Minekube runtime loads: a game on Paper, a proxy bundle on Velocity, or a client bundle in a Minecraft client - named by its content's hash, installed by writing the file.

A bundle is your built code as one JavaScript file. A Minekube runtime loads it from a folder, gives it a context of its own, and runs it against the platform's real API. Everything you write with Minekube Games reaches a server or client as a bundle.

## Three kinds, three platforms

The kind of a bundle is the platform it runs on. Each platform's runtime loads every `.js` file in its folder, and the file name, without `.js`, is the bundle's id.

| Bundle | Runs on | Written with | Loaded from |
| --- | --- | --- | --- |
| **Game** | Paper, in the Minekube plugin | `@minekube/paper` | `plugins/Minekube/games/<id>.js` |
| **Proxy bundle** | Velocity, in the Minekube plugin | The Velocity SDK | `plugins/minekube/bundles/<id>.js` |
| **Client bundle** | A Minecraft client with the Fabric runtime | `@minekube/client` | `minekube/bundles/<id>.js` in the client's game directory |

- **A game** is a game's rules and its server half: arenas, launchers, minigames, a hub's spawn. See [Game components](https://minekube.com/games/concepts/game).
- **A proxy bundle** programs the proxies in front of your servers: `/lobby`, where kicked players go, moving players between servers. A network can have one proxy, several or none, and a deployment by selector, such as `role=proxy`, runs the bundle on every matching proxy. [Proxy bundles](https://minekube.com/games/write/proxy-bundles) shows how to write one. See also [What is and is not a network](https://minekube.com/guide/networks/concepts/network#what-is-and-is-not-a-network).
- **A client bundle** plays the game as a player would: bots, test players, and the camera that streams a world to the browser.

## Why one file

A bundle is everything a runtime needs, in one file, so installing code is writing a file.

- **Nothing else to build or restart.** There is no plugin jar per game and no server restart. A runtime notices the new file and swaps it in while players stay connected.
- **Anything that writes a file can install one:** `mk dev` on every save, the connector when a network deploys a version, the bot daemon, or you by hand. On any Paper server with the Minekube plugin, a game in its `games` folder runs.
- **The content names it.** A bundle's SHA-256 identifies exactly what runs. When a file is rewritten with the same content, the runtime does nothing.

## How a bundle reaches its platform

| Path | What writes the file |
| --- | --- |
| Your dev server or dev network | `mk dev`, on every save |
| The servers of a network | The connector, from the network's [deployments](https://minekube.com/games/concepts/versions-and-deployments) |
| A bot or test client | The bot daemon, or a file you write into the client's folder |

A server can mix them. The connector removes only the bundles it wrote itself, and leaves a file of the same name that something else wrote, with a warning.

## What a bundle is not

- **Not a plugin.** A bundle cannot add Java classes or replace the runtime. It uses the platform's public API through the runtime, and a missing capability belongs in the Minekube plugin, not in the bundle.
- **Not a version.** A [version](https://minekube.com/games/concepts/versions-and-deployments) is a set of bundles, and what a network deploys.
- **Not shared between platforms.** A game cannot run on Velocity, and a proxy bundle cannot run on Paper: each is typed against its own platform's API.

## Related

- [Runtime and live swap](https://minekube.com/games/concepts/runtime): what the runtime does with a bundle.
- [Supported platforms](https://minekube.com/games/platform/supported-platforms): the platforms and versions each kind runs on.
- [Overview](https://minekube.com/games/overview#whats-in-a-project): what a project holds, and which file becomes which bundle.
