simon816 / Command-Block-Assembly

Compile high-level code into Minecraft commands
https://www.simon816.com/minecraft/assembler
MIT License
271 stars 29 forks source link

Load.json & Tick.json #23

Closed Nolij closed 3 years ago

Nolij commented 4 years ago

Fantastic project. Will be using this for a few things.

Is it possible to have a function be called upon /reload and every tick? Would be very useful.

simon816 commented 4 years ago

Yes you can, like so:

include "Events"
include "Text"

[Event Events.tick]
void on_tick() {
    Text t;
    t << "tick";
    t.send_to_all();
}

[Event Events.load]
void on_load() {
    Text t;
    t << "load";
    t.send_to_all();
}