Package jss.commandapi
Class SubCommand
- java.lang.Object
-
- jss.commandapi.SubCommand
-
public abstract class SubCommand extends Object
Represents a subcommand that can be executed within a custom command.- Version:
- 0.0.1-alpha
- Author:
- jonagamerpro1234
-
-
Constructor Summary
Constructors Constructor Description SubCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
allowConsole()
Checks if the subcommand can be executed from the console.abstract String
disabledMessage()
Gets the disabled message for the subcommand.abstract boolean
isEnabled()
Checks if the subcommand is enabled.abstract String
name()
Gets the name of the subcommand.abstract boolean
onCommand(org.bukkit.command.CommandSender sender, String[] args)
Executes the subcommand.abstract String
permission()
Gets the permission required to execute the subcommand.abstract boolean
requiresPermission()
Checks if the subcommand requires permission to be executed.
-
-
-
Method Detail
-
name
public abstract String name()
Gets the name of the subcommand.- Returns:
- The name of the subcommand.
- Since:
- 0.0.1-alpha
-
permission
public abstract String permission()
Gets the permission required to execute the subcommand.- Returns:
- The permission required to execute the subcommand.
- Since:
- 0.0.1-alpha
-
requiresPermission
public abstract boolean requiresPermission()
Checks if the subcommand requires permission to be executed.- Returns:
true
if the subcommand requires permission,false
otherwise.- Since:
- 0.0.1-alpha
-
onCommand
public abstract boolean onCommand(org.bukkit.command.CommandSender sender, String[] args)
Executes the subcommand.- Parameters:
sender
- The CommandSender executing the subcommand.args
- The arguments provided for the subcommand.- Returns:
true
if the subcommand was executed successfully,false
otherwise.- Since:
- 0.0.1-alpha
-
allowConsole
public abstract boolean allowConsole()
Checks if the subcommand can be executed from the console.- Returns:
true
if the subcommand can be executed from the console,false
otherwise.- Since:
- 0.0.1-alpha
-
isEnabled
public abstract boolean isEnabled()
Checks if the subcommand is enabled.- Returns:
true
if the subcommand is enabled,false
otherwise.- Since:
- 0.0.1-alpha
-
disabledMessage
public abstract String disabledMessage()
Gets the disabled message for the subcommand.- Returns:
- The disabled message for the subcommand.
- Since:
- 0.0.1-alpha
-
-