Getting started
Command Manager
The command manager is responsible for doing almost everything in the framework, from registering commands to customizing messages.
To start, first add it to your onEnable
method.
Creating Commands
Now you have to create your first command class.
Let's call it CommandTest
for an example.
Every command class must extend CommandBase.
Inside this class we can add our commands and subcommands.
First let's do the equivalent to /commandtest
simply to send a message saying Hello!
.
Done! That simple.
Now to add a subcommand called test
that'll send a message saying Test!
.
The first parameter will dictate if the command can be executed by the console and player or just the player. If the first parameter is Player player
instead of CommandSender sender
it'll automatically make a player only command!
Registering Commands
To register the commands we just created we simply go back to the onEnable
method and add the following.
That's all for the basic commands, for the more advanced ones you can just keep reading!
Last updated