Package net.jeqo.bloons.commands.manager
Class Command
java.lang.Object
net.jeqo.bloons.commands.manager.Command
- Direct Known Subclasses:
CommandEquip
,CommandForceEquip
,CommandForceUnequip
,CommandReload
,CommandUnequip
The base class for all commands within the plugin
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe description of the commandprotected org.bukkit.plugin.java.JavaPlugin
The plugin instance -
Constructor Summary
ConstructorsConstructorDescriptionCommand
(org.bukkit.plugin.java.JavaPlugin providedPlugin) Creates a new command instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommandAlias
(String alias) Adds alias commands to the current command, needed especially for the primary command name.abstract boolean
The functionality run on the successful execution of a commandboolean
hasRequirement
(org.bukkit.command.CommandSender sender, CommandPermission permission) Checks if the command meets the requirements to be executed
-
Field Details
-
plugin
protected org.bukkit.plugin.java.JavaPlugin pluginThe plugin instance -
commandDescription
The description of the command
-
-
Constructor Details
-
Command
public Command(org.bukkit.plugin.java.JavaPlugin providedPlugin) Creates a new command instance- Parameters:
providedPlugin
- The plugin instance, type org.bukkit.plugin.java.JavaPlugin
-
-
Method Details
-
addCommandAlias
Adds alias commands to the current command, needed especially for the primary command name. Note: All aliases added here must be added to the plugin.yml file- Parameters:
alias
- The alias to add to the command, type java.lang.String
-
execute
public abstract boolean execute(org.bukkit.command.CommandSender sender, String[] args) throws Exception The functionality run on the successful execution of a command- Parameters:
sender
- The sender of the command, type org.bukkit.command.CommandSenderargs
- The arguments of the command, type java.lang.String[]- Returns:
- Whether the command was executed successfully, type boolean
- Throws:
Exception
- If an error occurs during command execution, type java.lang.Exception
-
hasRequirement
public boolean hasRequirement(org.bukkit.command.CommandSender sender, CommandPermission permission) Checks if the command meets the requirements to be executed- Parameters:
sender
- The sender of the command, type org.bukkit.command.CommandSenderpermission
- The permission required to execute the command, type net.jeqo.bloons.commands.manager.types.CommandPermission- Returns:
- Whether the command meets the requirements, type boolean
-