Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.55 KB

File metadata and controls

49 lines (41 loc) · 1.55 KB
layout home
hero
name text tagline image actions
Helix Compiler
A TypeScript library to create datapacks
Write your datapack in TypeScript and let the compiler generate the .mcfunction and JSON files for you.
src alt
/logo.svg
Helix Compiler
theme text link
brand
Get started
/guide/getting-started
theme text link
alt
Examples
/examples/
features
title details link
<span class="feat-name">HELIX</span><span class="feat-role">the compiler</span>
Typed selectors, scores, items and commands. Autocomplete instead of guesswork, and errors before you're in-game.
/guide/helix
title details link
<span class="feat-name">TWINE</span><span class="feat-role">the framework</span>
Organise a big pack into modules with setup and per-tick hooks, so features stay separate as the pack grows.
/guide/twine

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:

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);
});