-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
TheLipe edited this page Apr 17, 2026
·
3 revisions
Welcome to the official command-lib documentation.
command-lib is a lightweight annotation-driven command framework for Paper plugins. It registers commands directly in Bukkit's CommandMap, supports subcommands, parses typed arguments, and provides async tab completion without forcing large plugin.yml command sections.
- βοΈ Installation
- π Getting Started
- π§© Defining Commands
- π Arguments and Resolvers
- β¨οΈ Tab Completion
- π Permissions and Messages
- π§ͺ API Reference
- π οΈ Troubleshooting
- π€ Contributing and Support
- Annotation-driven command classes
- Runtime registration through Bukkit's
CommandMap - Default handlers, subcommands, and unknown-command fallbacks
- Built-in resolvers for common Paper and Bukkit types
- Custom argument resolvers and custom tab completers
- Async tab completion support on Paper
- Optional and joined arguments
- Java 21
- Paper
1.20+
Other Bukkit-compatible servers may work, but the current repository targets and documents Paper 1.20+.
public final class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
CommandManager manager = new CommandManager(this, true);
manager.registerCommand(new WarpCommand());
}
}@Command({"warp", "warps"})
@Permission("example.warp")
public final class WarpCommand extends CustomCommand {
@Default
public void defaultCommand(CommandSender sender) {
sender.sendMessage("Use /warp teleport <player>");
}
@SubCommand("teleport")
@Permission("example.warp.teleport")
@TabComplete("@players")
public void teleport(CommandSender sender, @Name("player") Player target) {
sender.sendMessage("Teleport target: " + target.getName());
}
@Unknown(true)
public void unknown(CommandSender sender) {
sender.sendMessage("Unknown subcommand.");
}
}At runtime the library works in three layers:
-
CommandManagerregisters commands, argument resolvers, and tab completers. -
RegisteredCommandscans aCustomCommandclass and builds runtime executors from annotations. -
CommandExecutorvalidates sender type, resolves arguments, and invokes the target method.
If you are new to the project, read the pages in this order: