Sueta
CO

Command Builder

2.2.0

A framework for constructing Bukkit commands

·Plugin

Command builder is a framework for constructing Bukkit commands. At its core, it allows you to write the essence of your command without having to worry about parsing arguments and plumbing things together. Here's a quick example that creates a calculator command for adding or subtracting two numbers:

public class MyPlugin extends JavaPlugin {

   @Override
   public void onEnable() {
       new CommandBuilder()
               .infer(this)
               .build(new ReflectionCommandCallback(this), getCommand("my-command"));
   }

   @ExecuteCommand
   private void execute(CommandContext ctx,
                        @StringSetArgument.Arg({ "add", "sub" }) String operation,
                        int a,
                        int b) {
       int result;
       if (operation.equals("add")) {
           result = a + b;
       } else {
           result = a - b;
       }

       ctx.getSender().sendMessage("The result is: " + result);
   }
}

Command builder also lets you define your own types of arguments and has other powerful features to make creating commands easy. Feel free to contact LlewVallis#5734 on Discord if there is any thing I can help with.

See the project's GitHub page for more information and installation instructions.

Similar projects

Plugin →