Honcho is a high-level Bukkit command framework that speeds up command creation via annotations.
We're not reinventing the wheel, but here are a couple things that Honcho can do:
- Easily create commands and subcommands using annotations.
- Convert user input directly into objects to use in commands.
- Automatically instantiate nested subcommands.
- Dynamically generate command usage to display to user.
To use Honcho in your project, run:
git clone https://github.com/joeleoli/honcho.git && cd honcho && mvn clean install
and then add this to your project's pom.xml:
<dependency>
<groupId>com.qrakn</groupId>
<artifactId>honcho</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Example - A command that broadcasts a message in chat (/broadcast <message>)
@CommandMeta(label = "broadcast")
public class BroadcastCommand {
public void execute(CommandSender sender, String message) {
Bukkit.broadcastMessage(ChatColor.AQUA + message);
}
}
Result (Honcho automatically generates command usage and converts String[] arguments into a single String)