I am trying to learn CBL, and I am having trouble with the event handler example compiling properly. I'm using this example, copied from the CBL syntax reference and modified slightly:
include "Text"
include "Events"
[Event Events.placed_block: {event.item.item: "minecraft:stone"}]
void on_stone_placed() {
Text t;
t += "Stone block placed";
t.send_to_all();
}
When I attempt to compile this with MCC, I get this error message:
Diagnostic:
Compiling function .cbl_init
Current basic block: BasicBlock(_internal/.cbl_init/entry)
entry:
src/main.cbl:0:0: error: __init__() missing 2 required positional arguments: 'func_members' and 'func_properties'
If I rewrite my code as follows:
include "Text"
include "Events"
[Event Events.placed_block]
void on_stone_placed() {
Text t;
t += "Stone block placed";
t.send_to_all();
}
Then it compiles with no errors.
What (if anything) am I doing wrong, and how do I fix it?
I am trying to learn CBL, and I am having trouble with the event handler example compiling properly. I'm using this example, copied from the CBL syntax reference and modified slightly:
When I attempt to compile this with MCC, I get this error message:
If I rewrite my code as follows:
Then it compiles with no errors.
What (if anything) am I doing wrong, and how do I fix it?
Thanks!