HomeJavaMods[API] CommandAPI [1.20-26.1]
[API] CommandAPI [1.20-26.1]
[​IMG]

An API to use the command UI introduced in Minecraft 1.13


Everything you'll ever need can be found on the GitHub page

What is the CommandAPI?
The CommandAPI provides full support for the new command UI which was implemented in Minecraft's 1.13 update.

[​IMG]


Wanna stay up to date? We've got a Discord server!

Brief overview of features
Argument type casting
Instead of checking if an argument is an integer after they run the command like this:
Code (Java):
onCommand (CommandSender sender, Command command, String label, String [ ] args ) {
    try {
        int i = Integer. parseInt (args [ 0 ] ) ;
        // Do something with this number
    catch ( NumberFormatException e ) {
        // Do something with the fact this isn't a number...
    }
}
You can rest assured that the CommandAPI has inferred whatever type you want and can jump straight to this:
Code (Java):
new CommandAPICommand ( "mycommand" )
    . withArguments ( new IntegerArgument ( "myint" ) )
    . executes ( (sender, args ) -> {
        int i = ( int ) args. get ( "myint" ) ;
        // Do something with this number
    } )
    . register ( ) ;
The CommandAPI offers over 40 different arguments to tailor to your needs! Automatic casting to Enchantments, EntityTypes, Locations, ItemStacks, PotionEffects and many more!

CommandSender type checks
Never again will you have to check if your sender is a player! The CommandAPI provides automatic command sender checks for all sorts of command senders:
Code (Java):
new CommandAPICommand ( "mycommand" )
    . withArguments (arguments )
    . executesPlayer ( (player, args ) -> {
        player. sendMessage ( "Hi " + player. getDisplayName ( ) ) ;
    } )
    . register ( ) ;
Documentation
The latest documentation can be found here. Trust me, you've never, ever seen documentation this good before.

Built-in plugin converter

Bummed that your plugin's commands can't be used with the /execute command and don't know how to write code? The CommandAPI has you covered! With its built-in plugin command conversion system, you can make any plugin command compatible with Minecraft's /execute command and datapacks!

Still not convinced?

Here's what else it can do:
Need I say more?

Plugin details

Read from the plugin's own plugin.yml.

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.

[API] CommandAPI [1.20-26.1] is a free Minecraft Java mod. Compatible with Minecraft 1.13, 1.14, 1.15, 1.16 and newer. Downloaded 51,559 times (via Spigot). Download it and open it directly in the game.

Explore more