Bundles
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
Section titled “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/ |
| Proxy bundle | Velocity, in the Minekube plugin | The Velocity SDK | plugins/ |
| 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.
- 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 asrole=proxy, runs the bundle on every matching proxy. Proxy bundles shows how to write one. See also 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
Section titled “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 devon 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 itsgamesfolder 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
Section titled “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 |
| 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
Section titled “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 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
Section titled “Related”- Runtime and live swap: what the runtime does with a bundle.
- Supported platforms: the platforms and versions each kind runs on.
- Overview: what a project holds, and which file becomes which bundle.
Was this helpful?
Thanks for the feedback.