First Command
This page will describe how you can create your first command with Delegate
Hooking
Delegate is platform agnostic, but it still needs a way to hook itself into the platform you are using. This is done by hooking your plugin. Hooking your plugin is easy. The example below shows you how to hook using the Paper/Spigot/Bukkit implementation.
Make sure to hook your plugin. If your plugin is not hooked, commands will not work!
Your First Command
Let's break down what is happening here. A command in delegate is always created using the create()
-method which can be called on the Delegate
object:
This will create a ICommandBuilder
depending on your selected platform (e.g. if you are using the Paper implementation, this will be a PaperCommandBuilder
). This is a builder that can be used to chain attributes to your command. Furthermore, depending on your platform, some builders may offer other attribute options. In the next section we'll take a closer look at what these command attributes are.
Last updated