This guide uses the Standalone platform — no Minecraft server required. You will define an annotated command class, wire up the annotation processor in Maven, and execute your first command from a plainDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProjectUnified/CraftCommand/llms.txt
Use this file to discover all available pages before exploring further.
main method. The same annotation model applies to the Bukkit and Paper platforms; only the runtime dependency and processor artifact change.
Add the BOM
Import the
craftcommand-bom into your project’s <dependencyManagement> block. This lets you declare all other CraftCommand dependencies without specifying a version on each one.pom.xml
Add the runtime and annotation dependencies
Add
craftcommand-annotations (contains @Command, @Subcommand, @Default, @Optional, etc.) and craftcommand-standalone-runtime (contains StandaloneCommandManager and StandaloneCommand) to your <dependencies>. Because the BOM manages versions, no <version> tag is needed here.pom.xml
Configure the annotation processor
Register
craftcommand-standalone-processor as an annotation processor path in the maven-compiler-plugin. The processor runs during compilation and generates the *_Standalone wrapper classes — it must be in <annotationProcessorPaths>, not in <dependencies>.pom.xml
Write your command class
Annotate a plain Java class with
@Command to declare the root command name and description. Mark the fallback method with @Default and individual subcommands with @Subcommand. Use @Optional to make a parameter optional with a default value, and @Min (from the validation module) to enforce a numeric lower bound.The example below is taken directly from the CraftCommand standalone example module:CalculatorCommand.java
What happens at compile time
When Maven compilesCalculatorCommand.java, craftcommand-standalone-processor detects the @Command("calc") annotation and generates a new class called CalculatorCommand_Standalone in your build output. That class implements StandaloneCommand and contains switch-based dispatch logic that maps string subcommand tokens to direct calls to your add(), subtract(), multiply(), enumOp(), whoAmI(), etc. methods. It also wires in any @Min / @ValidateWith validation checks before the method body runs.
At runtime, StandaloneCommandManager.register() performs exactly one Class.forName("...CalculatorCommand_Standalone") call to locate the generated class, constructs it, and registers it. From that point on, every cmd.execute() and cmd.tabComplete() call goes through ordinary generated Java — no reflection per invocation.