[API] CommandAPI [1.13 - 1.16.5] v5.11

An API to use the command UI introduced in Minecraft 1.13

  1. Skepter
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/JorelAli/CommandAPI
    [​IMG]

    A Bukkit/Spigot 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 now got a Discord server!

    Brief overview of features
    • Better commands - Prevent players from running invalid commands, making it easier for developers
    • Better arguments - Easily switch from Location arguments to raw JSON, fully supported with built-in error checking
    • Support for proxied command senders - Run your command as other entities using /execute as ... run command
    • Support for the /execute command - Let your command to be executed by the built in /execute command
    • 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 other dependencies - You don't need to import Brigadier in your projects to use the CommandAPI
    • No tracking - The CommandAPI don't collect any stats about its plugin; what you see is what you get!
    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(arguments)
        .executes((sender, args) -> {
            int i = (int) args[0];
            //Do something with this number
        })
        .register();
    The CommandAPI offers over 40 different arguments to tailor to your needs! Automatic casting to Enchantments, EntityTypes, Location, ItemStacks, PotionEffects and many more!

    CommandSender type checks
    Never again will you have to check if your player is a sender! 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:
    • Parse integers with ranges automatically (force your command to only accept values within a range)
    • Handle integer and floating point locations, as well as relative locations using the ~ symbol
    • Parse raw JSON and convert it straight into a BaseComponent[]
    • Parse online players, with suggestions based on who's online
    • Create custom arguments that parse Strings into custom defined objects
    • Apply permissions to specific arguments - you need permissions to even see the suggested arguments as well as run it
    • Make other plugins that weren't written with the CommandAPI compatible with the /execute command
    • Handle results and successes of commands just like you can with command blocks
    • Set context-aware suggestions based on what the user has already entered into their command prompt
    Need I say more?

Recent Updates

  1. CommandAPI v5.11
  2. CommandAPI v5.10
  3. CommandAPI v5.9

Recent Reviews

  1. i0xHeX
    i0xHeX
    5/5,
    Version: v5.9
    Great API, but it could be better with some support of BungeeCord for example. I know it's not possible to implement every single feature supported by Spigot (however why not implement possible features?), but also not convenient to switch to another framework or make something own.
  2. NicoNeko
    NicoNeko
    5/5,
    Version: v5.5
    I give you credit! Extensive documentation, simple command registration. (.....)
  3. Argetan
    Argetan
    5/5,
    Version: v5.3
    The API is very easy to use for developers. There is a ton of detailed documentation and the support by the author is also excellent!
  4. playajames
    playajames
    5/5,
    Version: v5.2
    Very nice API! This library is very well written and has extensive documentation.
  5. Zoltus
    Zoltus
    5/5,
    Version: v5.1
    Awesome must have api. Saves a lot of time and pain.
    Fast support. Got help instantly when I needed it !
  6. Reekko
    Reekko
    5/5,
    Version: v4.3b
    The plugin is very advanced, helpful and quite easy to use, granting features that are otherwise impossible. Endless new possibilities for server developers. The creator is also VERY responsive and understanding.
    The wiki page is also very easy to read and understand.

    Overall I'm very happy to find this plugin!
  7. lavilaya
    lavilaya
    5/5,
    Version: v4.3
    This is arguably the most advanced, feature-rich and well-documented API for Spigot I've ever seen. Incredible developer experience out there, keep it up!
  8. Tinkot
    Tinkot
    5/5,
    Version: v1.8.2
    Amazing! works great, i've tried several other api's but they're all so hard to understand with such little documentation. big plus for this API, about to use this for all my future plugins. Hope you keep updating it!
  9. DogeBogey
    DogeBogey
    5/5,
    Version: v1.7.2
    Works wonderful! Using my own commands together with vanilla command is something spigot never really offered and this does!
  10. Combustible
    Combustible
    5/5,
    Version: v1.6
    This API is fantastic and well supported. It is the only reason my server was able to update to 1.13.

    It looks like Spigot may never support custom plugin commands running from /execute or functions - but with CommandAPI everything works exactly as it should. Plugin commands become exactly as powerful as vanilla commands (and they are treated the same!)

    You get tab complete (for free!), input sanitation and type casting (for free!), dynamic arguments, etc. You even get the ability to finally return whether the command succeeded or not and what the result value is (you could never do this with Spigot)!

    Despite all the additional features, the number of lines of code in my plugins to process these new commands dropped by more than half, and I have far fewer bugs parsing user input (because it does that for you!)

    Seriously, this is the next ProtocolLib. Every developer making custom plugin commands in the 1.13 era should use this API.