Brigadier
A javascript version of Mojangs Brigadier library
Install / Use
npx skills add remtori/brigadierInstalls into whichever agent you are using.
README
Node-Brigadier
This is a nodejs version of Mojang's Brigadier library.
Brigadier is a command parser & dispatcher, designed and developed for Minecraft: Java Edition and now freely available for use elsewhere under the MIT license.
Installation
npm install node-brigadier --save
Usage
Dispatch a command
const { CommandDispatcher, literal, argument, string, Suggestions } = require("node-brigadier")
class BlockPos {
constructor(x = 0, y = 0, z = 0) {
this.x = x; this.y = y; this.z = z;
}
parse(reader) {
this.x = reader.readInt();
reader.skip();
this.y = reader.readInt();
reader.skip();
this.z = reader.readInt();
return this;
}
listSuggestions(context, builder) {
return Suggestions.empty();
}
getExamples() {
return [
"1 2 3"
]
}
}
const dispatcher = new CommandDispatcher();
dispatcher.register(
literal("fill").then(
argument("pos1", new BlockPos()).then(
argument("pos2", new BlockPos()).then(
argument("block", string()).executes(context => {
console.log(context.getArgument("pos1", BlockPos))
console.log(context.getArgument("pos2", BlockPos))
console.log(context.getArgument("block", /*String*/ 3))
return 0;
})
)
)
)
)
const parsedCommand = dispatcher.parse("fill 3 4 5 10 11 12 air", {})
try {
dispatcher.execute(parsedCommand);
} catch (ex) {
console.error(ex.getMessage());
}
// Console
// BlockPos { x: 3, y: 4, z: 5 }
// BlockPos { x: 10, y: 11, z: 12 }
// air
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR
