Annotation-driven commands for Paper plugins.
Runtime registration, typed arguments, subcommands, permissions, and async tab completion without large plugin.yml command sections.
command-lib is a lightweight command framework for Paper plugins built around annotations and runtime registration.
It keeps command code direct while covering the repetitive parts that usually spread across plugin projects:
- command registration without large
plugin.ymlcommand sections - typed argument parsing for common Bukkit and Paper types
- subcommands, default handlers, and unknown handlers
- permission handling at class and method level
- async tab completion support on Paper
- custom argument resolvers and custom tab completers
Other Bukkit-compatible servers may work, but the current repository targets and documents Paper 1.20+.
Note
Replace TAG with a Git tag, release version, or commit hash from this repository.
Gradle (Kotlin DSL)
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.thelipe7:command-lib:TAG")
}Gradle (Groovy DSL)
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.thelipe7:command-lib:TAG'
}Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.thelipe7</groupId>
<artifactId>command-lib</artifactId>
<version>TAG</version>
</dependency>
</dependencies>Create a manager in your plugin:
public final class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
CommandManager manager = new CommandManager(this, true);
manager.registerCommand(new WarpCommand());
}
}Then define a command class:
@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.");
}
}- Installation
- Getting Started
- Defining Commands
- Arguments and Resolvers
- Tab Completion
- Permissions and Messages
- API Reference
- Troubleshooting
Use the issue templates for:
- bugs and regressions
- feature requests
- usage questions
See CONTRIBUTING for contribution guidelines and review expectations.
Thank you so much for considering helping me, I truly appreciate it!
This project is licensed under the Apache License 2.0.
See LICENSE for details.