Support and Project Discussion:
Downloads & Documentation:
Other
Compatible Minecraft versions:
The list of what version of the CommandAPI you'll need to run on a specific version of Minecraft is as follows:
| Minecraft version | Compatible versions | Latest compatible
version | Minimum Java
version required
to run latest version | |---------------------|-----------------------------|------------------------------|-----------------------------------------------------------| | 1.13.x | v1.0 - 5.12, 8.3.0 - 8.8.0 | 8.8.0 | 16 | | 1.14.1, 1.14.2 | v2.0 - 5.12, 8.3.0 - 8.8.0 | 8.8.0 | 16 | | 1.14.3, 1.14.4 | v2.1 - 5.12, 8.3.0 - 8.8.0 | 8.8.0 | 16 | | 1.15.x | v2.3a - 5.12, 8.3.0 - 9.3.0 | 9.3.0 | 16 | | 1.16.1 | v3.0 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 | | 1.16.2 | v4.0 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 | | 1.16.3 | v4.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 | | 1.16.4 | v5.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 | | 1.16.5 | v5.7 - 7.0.0, 8.3.0 - 9.7.0 | 9.7.0 | 16 | | 1.17 | 6.0.x - 9.7.0 | 9.7.0 | 16 | | 1.17.1 | 6.1.x - 9.7.0 | 9.7.0 | 16 | | 1.18, 1.18.1 | 6.5.2 - 9.7.0 | 9.7.0 | 16 | | 1.18.2 | 6.5.4 - 9.7.0 | 9.7.0 | 16 | | 1.19 | 8.3.0 - 9.7.0 | 9.7.0 | 16 | | 1.19.1 | 8.5.0 - 9.7.0 | 9.7.0 | 16 | | 1.19.2 | 8.5.1 - 9.7.0 | 9.7.0 | 16 | | 1.19.3 | 8.7.0 - 9.7.0 | 9.7.0 | 16 | | 1.19.4 | 8.8.0 - 9.7.0 | 9.7.0 | 16 | | 1.20 | 9.0.2 - 11.1.0 | 11.1.0 | 17 | | 1.20.1 | 9.0.3 - 11.1.0 | 11.1.0 | 17 | | 1.20.2 | 9.2.0 - 11.1.0 | 11.1.0 | 17 | | 1.20.3, 1.20.4 | 9.3.0 - 11.1.0 | 11.1.0 | 17 | | 1.20.5, 1.20.6 | 9.4.0 - 11.1.0 | 11.1.0 | 17 | | 1.21 | 9.5.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.1 | 9.5.2 - 11.1.0 | 11.1.0 | 17 | | 1.21.2, 1.21.3 | 9.6.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.4 | 9.7.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.5 | 10.0.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.6 | 10.1.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.7 | 10.1.1 - 11.1.0 | 11.1.0 | 17 | | 1.21.8 | 10.1.2 - 11.1.0 | 11.1.0 | 17 | | 1.21.9, 1.21.10 | 11.0.0 - 11.1.0 | 11.1.0 | 17 | | 1.21.11 | 11.1.0 | 11.1.0 | 17 | | 26.1.X | 11.2.0 | 11.2.0 | 17 |
This project provides an API to help Bukkit/Spigot developers use the Minecraft 1.13 command UI, which includes:


/execute as ... run command

Support for the /execute command - Let your command to be executed by the built in /execute command, as well as command blocks!
Support for Minecraft's functions - Allow your command to be executed from Minecraft's functions and tags
No plugin.yml registration - Commands don't need to be registered in the plugin.yml file anymore
No need for Brigadier - You don't need to import Brigadier in your projects to use the CommandAPI
No tracking - The CommandAPI doesn't collect any stats about its plugin; what you see is what you get!
Still not convinced? In addition to all of the above, the CommandAPI also provides:
/execute-compatible ones - no code required!CommandTreeSimple command registration
new CommandAPICommand("enchantitem")
.withArguments(new EnchantmentArgument("enchantment"))
.withArguments(new IntegerArgument("level", 1, 5))
.executesPlayer((player, args) -> {
Enchantment enchantment = (Enchantment) args.get("enchantment");
int level = (int) args.get("level");
//Add the enchantment
player.getInventory().getItemInMainHand().addEnchantment(enchantment, level);
})
.register();
Potion removing, suggesting potions that a player has currently
List<Argument<?>> arguments = new ArrayList<>();
arguments.add(new EntitySelectorArgument.OnePlayer("target"));
arguments.add(new PotionEffectArgument("potioneffect").replaceSafeSuggestions(SafeSuggestions.suggest(info -> {
Player target = (Player) info.previousArgs().get("target");
//Convert PotionEffect[] into PotionEffectType[]
return target.getActivePotionEffects().stream()
.map(PotionEffect::getType)
.toList().toArray(new PotionEffectType[0]);
})));
new CommandAPICommand("removeeffect")
.withArguments(arguments)
.executesPlayer((sender, args) -> {
Player player = (Player) args.get("target");
PotionEffectType effect = (PotionEffectType) args.get("potioneffect");
player.removePotionEffect(effect);
})
.register();
Subcommands
new CommandAPICommand("perm")
.withSubcommand(new CommandAPICommand("group")
.withSubcommand(new CommandAPICommand("add")
.withArguments(new StringArgument("permission"))
.withArguments(new StringArgument("groupName"))
.executes((sender, args) -> {
//perm group add code
})
)
.withSubcommand(new CommandAPICommand("remove")
.withArguments(new StringArgument("permission"))
.withArguments(new StringArgument("groupName"))
.executes((sender, args) -> {
//perm group remove code
})
)
)
.withSubcommand(new CommandAPICommand("user")
.withSubcommand(new CommandAPICommand("add")
.withArguments(new StringArgument("permission"))
.withArguments(new StringArgument("userName"))
.executes((sender, args) -> {
//perm user add code
})
)
.withSubcommand(new CommandAPICommand("remove")
.withArguments(new StringArgument("permission"))
.withArguments(new StringArgument("userName"))
.executes((sender, args) -> {
//perm user remove code
})
)
)
.register();
Command trees
new CommandTree("perm")
.then(new MultiLiteralArgument("group", "user")
.then(new MultiLiteralArgument("add", "remove")
.then(new StringArgument("permission")
.then(new StringArgument("groupName")
.executes((sender, args) -> {
// args = ["group" or "user", "add" or "remove", permission, groupName]
})
)
)
)
)
.register();
<su
$ claude mcp add CommandAPI \
-- python -m otcore.mcp_server <graph>