Class TippieCommand
java.lang.Object
me.tippie.tippieutils.v1_2_0.commands.TippieCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor
Represents a TippieCommand which you can extend to use.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe description of this command used in generated help messages.protected StringThe name of this command.protected StringThe permission needed to execute this commandprotected StringThe prefix used in the help message.protected intThe sublevel of this command. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompletes(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)Called when the command is tab completed.voidexecutes(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)Called when the command is tab executed.The description of this command used in generated help messages.getName()The name of this command.The permission needed to execute this commandThe prefix used in the help message.The registered subcommands of this command.intThe sublevel of this command.booleanonCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)protected voidsendHelpMessage(org.bukkit.command.CommandSender sender, String label, String prefix)Sends a help message about the subcommands of this command when called.
-
Field Details
-
name
The name of this command. -
description
The description of this command used in generated help messages. -
permission
The permission needed to execute this command -
subLevel
protected int subLevelThe sublevel of this command. This indicates how deep the command is within subcommands. For example, if this command is the root command, then this value is 0. If this command is a subcommand of another command, then this value is 1. -
prefix
The prefix used in the help message.
-
-
Constructor Details
-
TippieCommand
public TippieCommand()
-
-
Method Details
-
onCommand
@Internal public final boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)- Specified by:
onCommandin interfaceorg.bukkit.command.CommandExecutor
-
onTabComplete
@Nullable @Internal public final @Nullable List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, @NotNull @NotNull String[] args)- Specified by:
onTabCompletein interfaceorg.bukkit.command.TabCompleter
-
completes
public List<String> completes(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)Called when the command is tab completed.- Parameters:
sender- The sender of the command.command- The command.alias- The alias of the command. This is the same as thenameof the command.args- The arguments of the command. This does not include the subcommand.Example the command '/test subcommand argument' would only have 'argument' here- Returns:
- The list of completions
-
executes
public void executes(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args) throws NoSuchMethodExceptionCalled when the command is tab executed.- Parameters:
sender- The sender of the command.command- The command.label- The alias of the command. This is the same as thenameof the command.args- The arguments of the command. This does not include the subcommand.Example the command '/test subcommand argument' would only have 'argument' here- Throws:
NoSuchMethodException- See Also:
me.tippie.tippieutils.v1_2_0.commands.annotations
-
sendHelpMessage
protected void sendHelpMessage(org.bukkit.command.CommandSender sender, String label, String prefix)Sends a help message about the subcommands of this command when called.- Parameters:
sender- The command sender to send the help message to.label- The label of the command.prefix- The prefix used in the help message.
-
getName
The name of this command.- Returns:
- The name of this command.
-
getDescription
The description of this command used in generated help messages.- Returns:
- The description of this command.
- See Also:
sendHelpMessage(CommandSender, String, String)
-
getPermission
The permission needed to execute this command- Returns:
- The permission needed to execute this command
-
getSubLevel
public int getSubLevel()The sublevel of this command. This indicates how deep the command is within subcommands. For example, if this command is the root command, then this value is 0. If this command is a subcommand of another command, then this value is 1.- Returns:
- The sublevel of this command.
-
getPrefix
The prefix used in the help message.- Returns:
- The prefix used in the help message.
- See Also:
sendHelpMessage(CommandSender, String, String)
-
getSubCommands
The registered subcommands of this command.- Returns:
- The list of subcommands registered.
-