Home›Java›Mods›[API] commands-api
commands-api
Command libraries for spigot plugin

[​IMG] [​IMG] [​IMG] [​IMG] [​IMG]​


Command, useful method for interacting with players in Spigot plugin. I have realized that the Spigot Command's Api is not functional enough for larger projects. So the commands-api was created to replace it.

The commands-api is very easy to implement, deploy and use. It's compatible with all projects from small to large and any version of Spigot. Working with the root-child model, the root command equivalent to the spigot command and registered as PluginCommand. Reduce pass parameters for simplicity, custom command results, and more.

Notes: This is a library, not a spigot plugin.

Requirements
The source code used is java 8. Any java version lower than java 8 will cause errors.

Installation
There are many ways to install libraries to your plugin dependencies. You can follow this instruction.

Maven
Add this section inside <dependencies> tag in your pom.xml.
HTML:
<dependency>
  <groupId>xyz.tozymc.spigot </groupId>
  <artifactId>commands-api </artifactId>
  <version>2.2 </version>
</dependency>

Gradle

Follow this instruction if your build tool is Gradle.
Code (Java):
dependencies {
    implementation   'xyz.tozymc.spigot:commands-api:2.2'
}
Manual
If your project doesn't have any build tools, you can install it manually.

  1. Download the library in github release.
  2. Import commands-api-2.2.jar file to your project.
How to use
  1. Implement command default abstract classes and design your command.
  2. Declare new CommandController instance and register implemented commands in the section 1 in the order to the controller declared.
  3. Let's start server and enjoy.
Important Changes
Since version 2.0, you don't need to add command to plugin.yml. Why? The major feature update in version 2.0 is dynamic command registration. What is it? Simply, you can register commands anywhere and at any time. Unregistration is similar. So adding command to plugin.yml isn't necessary.

License
Distributed under the MIT License. See LICENSE for more information.

External Links

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] commands-api is a free Minecraft Java mod. Downloaded 343 times (via Spigot). Download it and open it directly in the game.

Explore more