CraftCommand is an opinionated, annotation-driven command framework for Java. Instead of scanning annotations at runtime with reflection, CraftCommand’s annotation processor reads yourDocumentation 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.
@Command and @Subcommand declarations at compile time and generates platform-native wrapper classes using JavaPoet. The result is near-native dispatch speed with no per-invocation reflection overhead.
Quickstart
Build and register your first annotated command in minutes
Installation
Add CraftCommand modules to your Maven project with the BOM
Core Concepts
Understand how compile-time processing and code generation work
Annotation Reference
Complete reference for every annotation CraftCommand provides
Why CraftCommand?
Most Java command frameworks rely on runtime reflection to discover and invoke annotated methods. CraftCommand takes a different approach: the annotation processor runs duringjavac and emits ordinary Java wrapper classes. By the time your application starts, the command routing is just a chain of plain method calls.
Zero Reflection per Call
One
Class.forName at registration time; zero reflection during every subsequent executionMulti-Platform
Standalone Java, Bukkit/Spigot, and Paper (Brigadier) — one annotation model across all platforms
Extensible via SPI
Register custom argument resolvers, validation handlers, and method handlers through standard Java SPI
Platform Support
- Standalone
- Bukkit / Spigot
- Paper (Brigadier)
Use CraftCommand in any Java application — CLI tools, Discord bots, chatbots, or test harnesses. No Minecraft dependency required.
pom.xml
Get Started in 4 Steps
Add the BOM and dependencies
Import
craftcommand-bom in your <dependencyManagement> block, then declare the annotations and runtime artifacts for your target platform.Configure the annotation processor
Add the platform-specific processor artifact (e.g.
craftcommand-standalone-processor) to maven-compiler-plugin’s <annotationProcessorPaths>. The processor runs automatically during mvn compile.Write your command class
Annotate a class with
@Command, define subcommands with @Subcommand, mark the default handler with @Default, and declare optional parameters with @Optional.CraftCommand targets Java 8 and above. All generated wrapper classes are plain Java — no bytecode manipulation, no proxies.