@Root
Marks a method as the root executor of a command - invoked when the base command is run with no subcommand arguments.
Usage
@Command(value = "mycommand", description = "My command")
public class MyCommand extends CommandBase {
@Root
public void root(CommandContext ctx) {
ctx.sender().sendMessage("Usage: /mycommand <subcommand>");
}
}
Notes
- Only one method per
@Commandclass may be annotated with@Root. A second@Rootmethod will throw anIllegalArgumentExceptionat registration time. - Arguments via
@Argare supported on a@Rootmethod the same as on@Sub.