Class CommandHandler
java.lang.Object
me.github.simonplays15.betterbansystem.bungeecord.CommandHandler
CommandHandler is responsible for handling commands in the plugin.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandHandler
(net.md_5.bungee.api.plugin.Plugin plugin) The CommandHandler class handles the registration of commands for the plugin. -
Method Summary
Modifier and TypeMethodDescriptionboolean
onCommand
(@NotNull net.md_5.bungee.api.CommandSender sender, @NotNull net.md_5.bungee.api.plugin.Command command, @NotNull String label, @NotNull String[] args) Executes a command.onTabComplete
(@NotNull net.md_5.bungee.api.CommandSender sender, @NotNull net.md_5.bungee.api.plugin.Command command, @NotNull String[] args) Retrieves a list of tab completion options for a given command.
-
Constructor Details
-
CommandHandler
public CommandHandler(net.md_5.bungee.api.plugin.Plugin plugin) The CommandHandler class handles the registration of commands for the plugin.
-
-
Method Details
-
onCommand
public boolean onCommand(@NotNull @NotNull net.md_5.bungee.api.CommandSender sender, @NotNull @NotNull net.md_5.bungee.api.plugin.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args) throws CommandException Executes a command.- Parameters:
sender
- the command sendercommand
- the command being executedlabel
- the command labelargs
- the command arguments- Returns:
- true if the command executed successfully, false otherwise
- Throws:
CommandException
-
onTabComplete
public Iterable<String> onTabComplete(@NotNull @NotNull net.md_5.bungee.api.CommandSender sender, @NotNull @NotNull net.md_5.bungee.api.plugin.Command command, @NotNull @NotNull String[] args) Retrieves a list of tab completion options for a given command.- Parameters:
sender
- The command sender who initiated the tab completion.command
- The command being executed.args
- The arguments provided after the command.- Returns:
- An Iterable containing possible tab completion options.
-