Class Commander
Info and Permissive annotations in order to be properly registered with the
CommandHandler.
One single method can be annotated with the Base annotation to specify that method should be called when the
command is executed without any arguments.
You are allowed to have as many methods as you want which are annotated with the Subcommand annotation. These
methods will be called when the command is executed with the specified subcommand.
You are also allowed to use multiple Completion annotations per method to define multiple tab completions for
a single subcommand. This would be useful in the case where you would like to include specific completion cases, but
also support basic String completion cases.
When creating Completion annotations, you only need to register arguments a single time per class. For more
information, see Subcommand.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommander(@NotNull org.bukkit.plugin.java.JavaPlugin plugin) Initializes this command object. -
Method Summary
Modifier and TypeMethodDescription@Nullable MethodGets the method which should be called when the command is executed without any arguments.@NotNull org.bukkit.plugin.java.JavaPlugin
-
Constructor Details
-
Commander
protected Commander(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin) Initializes this command object. The providedJavaPluginshould be the plugin which contains the command.This constructor will automatically register all subcommands and completions for this command. It will also automatically infer all required information from the provided
InfoandPermissiveannotations.- Parameters:
plugin- The plugin which contains this command.
-
-
Method Details
-
getBaseMethod
Gets the method which should be called when the command is executed without any arguments.
This method will return null if the command does not have a base method.- Returns:
- The base method for this command, or null if the command does not have a base method.
-
getPlugin
@NotNull public @NotNull org.bukkit.plugin.java.JavaPlugin getPlugin()- Returns:
- The plugin which owns this command.
-