Command Framework 1.0.5

A lightweight annotation based command system

  1. Despical
    Native Minecraft Version:
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Source Code:
    Command Framework

    This framework is very lightweight annotation based command system that works similar to Bukkit's event system. It removes the necessity to add command to your plugin.yml but will still allow you to set command usage, description, permission, aliases, sender type, cooldown, minimum and maximum argument length through the code and adds bunch of new methods to improve your code.


    More information can be found on the wiki page. The Javadoc can be browsed. Questions related to the usage of Command Framework should be posted on my Discord server.

    Using Command Framework

    The project isn't in the Central Repository yet, so specifying a repository is needed.
    To add this project as a dependency to your project, add the following to your pom.xml:

    Maven dependency
    Code (XML):
    Code (XML):

    Gradle dependency

    Code (XML):
    repositories {
       maven { url '' }
    Code (XML):
    dependencies {
       compileOnly group: "com.github.Despical", name: "CommandFramework", version: "1.0.6-pre1";

    Example usage

    Code (Java):
    public class ExampleClass extends JavaPlugin {

       // Don't forget to shade framework into your project
       private CommandFramework commandFramework;

       public void onEnable() {
           // Initialize the framework before using
           commandFramework = new CommandFramework(this);

           // Then this will register all the @Command methods as a command
           // so there is no necessity to add command to your plugin.yml
           commandFramework.setAnyMatch(arguments -> {
               if (arguments.isArgumentsEmpty()) return;

               String label = arguments.getLabel(), arg = arguments.getArgument(0);
               // StringMatcher is an external class from Despical's Commons library which is not in this framework
               ListStringMatcher.Match> matches = StringMatcher.match(arg, commandFramework.getCommands().stream().map(cmd -> + ".", "")).collect(Collectors.toList()));

               if (!matches.isEmpty()) {
                   arguments.sendMessage("Did you mean %command%?").replace("%command%", label + " " + matches.get(0).getMatch());

       // Before creating command the method must only have
       // CommandArguments parameter and also @Command annotation
       @Command(name = "example",
               aliases = {"firstAlias", "secondAlias"},
               permission = "example.permission",
               desc = "Sends an example message to sender",
               usage = "/example",
               min = 1,
               max = 5,
               cooldown = 10,
               senderType = Command.SenderType.CONSOLE)
       public void exampleCommandMethod(CommandArguments arguments) {
           // And here it's all done, you've created command with properties above!
           arguments.sendMessage("This is how you can create a example command using framework.");

       // Aliases don't need to be same with the command above
       @Completer(name = "example", aliases = {"firstAlias", "secondAlias"})
       public List<String> exampleCommandCompletion(CommandArguments arguments) {
           // And you've created a tab completion for the command above
           return Arrays.asList("first", "second", "third");

    Example plugins

    You can always DM me if you are using this framework and want to be on list.


    You like the Command Framework? Then donate back me to support the development.

    Additional links
    kuani and _Obliviate_ like this.