Appearance
Getting started
Write a datapack in TypeScript and compile it for any supported Minecraft version.
Write a pack
ts
import { Datapack, Selector, v26_2 } from "helix";
const dp = new Datapack("mypack", v26_2);
dp.createFunction("load").build((ctx) => {
ctx.say("Hello, world!");
ctx.tellraw(Selector.allPlayers(), "Welcome!");
});
dp.writeDatapack("./out");Or try it in the playground.
Pick a package
| Package | Use it for |
|---|---|
| helix | the compiler: typed values and commands |
| spool | opt-in plugins (motion, cutscenes, entity sets...) |
| twine | structuring a whole pack as modules |
Each builds only on the one above it. See Architecture for why.
Build from source
Packages link each other's built dist/, so build in this order:
sh
npm --prefix helix install && npm --prefix helix run build
npm --prefix spool install && npm --prefix spool run build
npm --prefix twine install && npm --prefix twine run buildWARNING
After changing a package, rebuild it before anything that uses it, or you'll see stale types.