Skip to content

An API to use the new command UI introduced in Minecraft 1.13

License

Notifications You must be signed in to change notification settings

MatrixTunnel/1.13-Command-API

 
 

Repository files navigation

1.13-Command-API

An API to use the new command UI introduced in Minecraft 1.13

Purpose

This project provides an API to help Bukkit/Spigot developers use the new Minecraft 1.13 command UI. (Read about its creation in my blog post!)

commandUI

Basic principles (and changes between this API compared to normal command registration)

  • Commands are registered using the command registration system for default Minecraft commands. These are sent to the player in a special packet.
  • Commands registered using this Command API do not need to be stated in the plugin.yml (neither do they need a registered CommandExecutor)
  • This may be less compatible with plugins which lookup commands from other plugins For example, say we make a plugin with this api, called MyCustomPlugin. Say another plugin, PluginLookup tries to find the commands registered under MyCustomPlugin (either by viewing the plugin.yml or commandMap via reflection), it would not return any results.
  • Arguments are represented as their respective data types as opposed to Strings
    //Instead of 
    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 now do
    CommandAPI.getInstance().register("mycommand", arguments, (sender, args) -> {
      int i = (int) args[0];
      //Do something with this number
    });
  • Arguments require a description to identify them

Downloads & Documentation (includes usage for server owners)

Version Direct download Documentation
1.0 CommandAPI.jar Version 1.0 documentation
1.1 CommandAPI.jar Version 1.1 documentation
1.2 CommandAPI.jar Version 1.2 documentation
1.3 CommandAPI.jar Version 1.3 documentation
1.4 CommandAPI.jar Version 1.4 documentation
1.5 CommandAPI.jar Version 1.5 documentation
1.6 CommandAPI.jar Version 1.6 documentation
1.7.2 CommandAPI.jar Version 1.7 - 1.7.2 documentation
1.8.2 CommandAPI.jar Version 1.8 - 1.8.2 documentation

Changelog

  • Version 1.8.2
    • Fix bug with PlayerArgument when player cannot be found
    • Adds LocationArgument options for block precision or exact precision
  • Version 1.8.1
    • Fix permissions for argument from 1.8
    • Neaten up logging with verbose outputs
  • Version 1.8
    • Fix bugs where DynamicSuggestedArguments don't work as the last argument
    • Fix support for latest spigot version
    • Adds permissions for arguments
    • Adds support to override suggestions for arguments
  • Version 1.7.2
    • Fix a bug where default return value was 0 instead of 1, causing issues with commandblocks
  • Version 1.7.1
    • Fix a bug with permission checks. Other than that, it's the same as 1.7 (in terms of documentation)
  • Version 1.7
    • Adds DynamicSuggestedStringArguments for dynamically updating suggestions
    • Adds support for success and result values for /execute store
    • Overhaul permissions system so it works properly
    • Note: This version is incompatible with pre-1.7 version CommandAPI plugins
  • Version 1.6
    • Adds FunctionArguments to handle Minecraft functions
    • Remove useless test code
    • Fix bug with ProxiedCommandSender callee and caller
    • Adds Converter for legacy plugin support
    • Improved performance by caching NMS better than in version 1.5
  • Version 1.5
    • Adds ChatComponentArgument to handle raw JSON
    • Adds SuggestedStringArgument to suggest strings
    • Adds config file
    • Fix bug where command errors weren't being thrown
    • Improved performance by caching NMS
  • Version 1.4
    • Fix critical bug where arguments weren't being handled properly
    • Adds GreedyStringArgument
    • Adds various Exception classes
  • Version 1.3
    • Migrate to Maven
    • Remove unnecessary reflection
    • Adds EntitySelectorArgument
    • Adds LiteralArgument
    • Adds support for ProxiedCommandSender
  • Version 1.2
    • Adds TextArgument
  • Version 1.1
    • Adds PlayerArgument
    • Adds ParticleArgument
    • Adds ChatColorArgument
    • Adds EnchantmentArgument
    • Adds LocationArgument
    • Adds EntityTypeArgument
    • Adds permissions support
    • Adds alias support
  • Version 1.0
    • Initial release

About

An API to use the new command UI introduced in Minecraft 1.13

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%