Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

Random & delays ​

ctx.pick runs one of several bodies at random; ctx.wait and dp.after run a body later.

ts
ctx.pick([[3, (c) => c.say("common")], [1, (c) => c.say("rare")]]);
CallDoes
ctx.pick([[w, body], ...])runs one body, chance proportional to w
ctx.wait(time, body)runs body later, as and at the same entity
dp.after(ctx, time, body)runs body later, as the server

Delay per entity ​

Each entity waits on its own timer.

ts
ctx.wait(Time.seconds(2), (c) => c.particle(Particle.FLAME, Pos.here()));

WARNING

Locals don't carry across a wait, and an entity that's gone by then never runs it.

See also ​

Released under the MIT License · Credits
These docs were written with AI; the layout and every page have been reviewed by a human.