Home›Java›Mods›Command Builder
ModsJava

Command Builder

Java mod listed for Minecraft 1.16. Download on the author's site.

⬇ Download on Spigot
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:

Code (Java):

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.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Command Builder is a free Minecraft Java mod. Compatible with Minecraft 1.16. Downloaded 164 times (via Spigot). Download it and open it directly in the game.

Explore more