Repository navigation
Releases: poplar-mc/poplar
Releases · poplar-mc/poplar
Release list
v0.5.0
Breaking: the as keyword is removed.
- For a constant, use a number suffix:
0finstead of0 as float,1binstead oftrue 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 writesdata 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
withcompound without a key the function uses withon a variable declared as a number, string or list- an unknown selector option, a quoted selector value, or an unknown
type=id
- a name from your pack without
v0.4.2
- Numbers now have the same forms as Minecraft's SNBT:
0.5,0.05f,20d,1b,5sand5L. NBT from an old pack can be written as it is:var $item = {Count: 1b, chance: 0.05f};. poplar -vis short forpoplar --version.
v0.4.1
- Fix: an error inside
{{...}}now shows its real line and column, in commands,execute (...)andifchecks. Before, it showed1:2or the start of the statement.
v0.4.0
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};
withtakes a compound (constants or game values), a$variable, an entity path (@s.$SelectedItem),entity @sorblock ~ ~ ~.- A new standard library:
- math:
pow,sqrt,lerp,weightedRandom,sinandcos - lists:
count,contains,indexOf,sum,minOf,maxOf,reverseandsort reverseandsortput their result in$std:result- the text module is removed: write
/tellraw @s {{ {text: "hi"} }};instead
- math:
- Player events:
onFirstJoin,onJoin,onDeathandonRespawn. - Poplar's own objective is now
poplar.<namespace>, so a trigger can have the name of its namespace (onTrigger("showoff", ...)innamespace 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
- Add
poplar update: checks for a newer release, asks, and updates the copy you run.--yesskips the question.
v0.3.0
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, andload/tickper namespace, run in import order. self:nameandns:namein 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
ifandwhile: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
- Poplar is now MIT licensed; the standard library is MIT-0, so packs built with it need no license notice.
poplar watchwarns when no world is specified, since builds are not copied anywhere.
v0.2.1
poplar watchreads the world fromPOPLAR_WORLD(environment or.env);--worldoverrides it.poplar buildalways writes the zip; thezipfield inpoplar.jsonis removed.- Clearer, colored CLI output (set
NO_COLORto turn colors off). - Five new examples:
hello,mana,showoff,deathsandtoolkit. - 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.shupdates a runningpoplar.
Poplar v0.2.0
- Add the string helpers
slice,str,startsWithandendsWith(built on Minecraft'sdata 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
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>