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 →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta