First, require override-lib: const override = require("override-lib/library");
Then override something!
// Override a specific block by name
override.block("duo", {
buildConfiguration(table) {
table.button(Icon.warning, Core.app.exit);
}
});
Blocks.duo.configurable = true;
// Override a class of blocks
override.block(Conveyor, {
draw() {
// Make conveyors spin instead of animate
Draw.rect(this.block.region, this.x, this.y, Time.time * this.block.speed);
}
});
- Multiple mods overriding the same function currently isn't handled.
- Units probably don't work