-
Notifications
You must be signed in to change notification settings - Fork 1
Creating your command class
Dalton edited this page Apr 24, 2022
·
8 revisions
Instead of using Spigot/Paper's built-in Command Handling system, you may use the command handling system provided by BurchAPI! It offers a smooth functional interface API (Just like the PluginInventory!)
Creating an ApiCommnd requires you to have the 4 arguments:
- String - command name (Eg /commandNameHere)
- String - usage message (Eg Invalid syntax! Usage: /command )
- String - Description of the command
- ArrayList of Strings - This is for the aliases, this can be an empty ArrayList
The best way to register command is by extending the ApiCommand class:
public class HelpCommand extends ApiCommand {
}
The next step is to add either one of these annotations:
@RegisterCommand(
name = "helpcommand"
)
// OR
@CommandName( name = "helpcommand")
This Annotation sets the mandatory Command-Name for the command to be registered
To view more about the Annotations for commands this plugin provides view [url=https://google.com]this section here[/url] to view more about them!
The Annotation you choose goes on the top of the class file itself like so:
@RegisterCommand( name = "helpcommand" )
public class TestCommand extends ApiCommand {
}
Page written by: Dalton Burchard
- Your main class and you
- Editing API Settings (Optional)
- Creating an PluginInventory
- Creating Clickable items
- (Not added yet) Examples