Tree-based commands
To get started with OneConfig's tree-based (Brigadier-style) command system, you'll need to get started by creating a CommandBuilder:
From here, if you want to do something when the command is run on it's own (f.ex /examplemod
), you can use the runs
method to define what is executed, like so:
Both the object which command
and runs
returns have a description
method which allow you to describe what happens when you execute that command or subcommand, it is recommended to use this where possible.
Finally, to register your command, you can simply use CommandManager#registerCommand
like so:
Last updated