Annotation Interface Command
Marks a method as a command definition for registration via the
CommandBus.
Methods annotated with @Command must accept a single parameter of type
LiteralArgumentBuilder and will be invoked during command registration.
The method must be registered using CommandBus.register(String, Object) to be active.
The provided name is used as the literal root node of the Brigadier command.
Example usage:
@Command(name = "example")
public void exampleCommand(LiteralArgumentBuilder<CommandSourceStack> builder) {
builder.executes(ctx -> {
return 1;
});
}
-
Field Summary
Fields -
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements