Skip to content

Helix CompilerA TypeScript library to create datapacks

Write your datapack in TypeScript and let the compiler generate the .mcfunction and JSON files for you.

Helix Compiler

Write TypeScript, get a datapack

Here's a small function that greets every player and hands them some diamonds. The tabs below are the actual files the compiler produced from it:

ts
import { Datapack, v26_2, Selector, Item } from "helix";

const dp = new Datapack("welcome", v26_2);

dp.createFunction("greet").build((ctx) => {
  const players = Selector.allPlayers();
  ctx.tellraw(players, "Welcome to the server!");
  ctx.playerGive(players, Item.DIAMOND, 3);
});

▶ Open in playground

Compiled output - the real files helix emits for the code above:

txt
tellraw @a {"text":"Welcome to the server!"}
give @a minecraft:diamond 3

Released under the MIT License · Credits