Skip to content

Releases: poplar-mc/poplar

v0.5.0

Choose a tag to compare

@jordobaron jordobaron released this 04 Nov 21:46

Breaking: the as keyword is removed.

  • For a constant, use a number suffix: 0f instead of 0 as float, 1b instead of true as byte.
  • A score or math is stored as an int. In entity data, the game converts it to the type of the field, so @s.$Health = #hp; works. In storage, write /execute store result ... float 1 run ... for another type.

Also in this release:

  • $x = $(key); now writes data modify ... set value $(key), as a hand-written datapack does, so decimals, lists and compounds work.
  • New compile errors for mistakes that only failed in the game:
    • a name from your pack without self:: predicate isVehicle
    • a bare id with a capital letter where a function or data file goes
    • a with compound without a key the function uses
    • with on a variable declared as a number, string or list
    • an unknown selector option, a quoted selector value, or an unknown type= id

v0.4.2

Choose a tag to compare

@jordobaron jordobaron released this 04 Nov 16:45
  • Numbers now have the same forms as Minecraft's SNBT: 0.5, 0.05f, 20d, 1b, 5s and 5L. NBT from an old pack can be written as it is: var $item = {Count: 1b, chance: 0.05f};.
  • poplar -v is short for poplar --version.

v0.4.1

Choose a tag to compare

@jordobaron jordobaron released this 03 Nov 23:12
  • Fix: an error inside {{...}} now shows its real line and column, in commands, execute (...) and if checks. Before, it showed 1:2 or the start of the statement.

v0.4.0

Choose a tag to compare

@jordobaron jordobaron released this 03 Nov 22:56

Breaking: an mcfun has no parameter list. It reads macro arguments with $(name), and you pass them with with, the same as Minecraft's function ... with:

mcfun greet() { /say Hi $(name); }

greet() with {name: "Steve"};
greet() with $player;
std:min() with {a: #hp, b: 10};
  • with takes a compound (constants or game values), a $ variable, an entity path (@s.$SelectedItem), entity @s or block ~ ~ ~.
  • A new standard library:
    • math: pow, sqrt, lerp, weightedRandom, sin and cos
    • lists: count, contains, indexOf, sum, minOf, maxOf, reverse and sort
    • reverse and sort put their result in $std:result
    • the text module is removed: write /tellraw @s {{ {text: "hi"} }}; instead
  • Player events: onFirstJoin, onJoin, onDeath and onRespawn.
  • Poplar's own objective is now poplar.<namespace>, so a trigger can have the name of its namespace (onTrigger("showoff", ...) in namespace showoff). In an existing world, remove the old objective once: /scoreboard objectives remove <namespace>.
  • Fixes:
    • a field of a local, in a namespace other than the pack's, was written to the wrong storage
    • a {{$x}} line read the wrong storage for other namespaces
    • generated bodies no longer pass on arguments that they do not use

v0.3.1

Choose a tag to compare

@jordobaron jordobaron released this 03 Nov 03:13
  • Add poplar update: checks for a newer release, asks, and updates the copy you run. --yes skips the question.

v0.3.0

Choose a tag to compare

@jordobaron jordobaron released this 03 Nov 02:29

Breaking: every file now starts with namespace <name>;, imports are by namespace (import std;), and std functions are called as std:clamp(). Every .poplar file in src/ is built, so the entry field and path imports are removed.

  • Namespaces: namespace combat;, import magic;, magic:heal(), #magic:mana, and load/tick per namespace, run in import order.
  • self:name and ns:name in commands give the id of your mcfuns and data files, by their source names.
  • Data files: predicate, recipe, lootTable, tags, worldgen and more, with JSON from generators such as misode pasted in as it is.
  • Minecraft checks in if and while: if (block ~ ~-1 ~ #minecraft:logs and #mana > 5).
  • The standard library is copied into your pack under std/, so packs built with different Poplar versions cannot clash.

v0.2.2

Choose a tag to compare

@jordobaron jordobaron released this 02 Nov 02:50
  • Poplar is now MIT licensed; the standard library is MIT-0, so packs built with it need no license notice.
  • poplar watch warns when no world is specified, since builds are not copied anywhere.

v0.2.1

Choose a tag to compare

@jordobaron jordobaron released this 02 Nov 02:20
  • poplar watch reads the world from POPLAR_WORLD (environment or .env); --world overrides it.
  • poplar build always writes the zip; the zip field in poplar.json is removed.
  • Clearer, colored CLI output (set NO_COLOR to turn colors off).
  • Five new examples: hello, mana, showoff, deaths and toolkit.
  • Fix text() on a local score.
  • Fix the optimizer removing a local that is only read inside text() in call arguments.
  • Fix "Text file busy" when install.sh updates a running poplar.

Poplar v0.2.0

Choose a tag to compare

@jordobaron jordobaron released this 01 Nov 22:16
  • Add the string helpers slice, str, startsWith and endsWith (built on Minecraft's data modify ... set string).
  • Add onTrigger(name, callback): runs the callback when a player uses /trigger name. The pack checks it each tick for you.
  • Add install scripts (install.sh, install.ps1) and prebuilt archives for Linux, macOS and Windows (x86_64 and arm64).
  • Fix the build on Windows.

Poplar v0.1.0

Choose a tag to compare

@jordobaron jordobaron released this 01 Nov 21:10
Poplar: a language that compiles to Minecraft datapacks

The compiler (Zig 0.17.0), its standard library, the language server,
the end-to-end tests, the Tree-sitter and TextMate grammars, an example
project and the user documentation in docs.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>