public interface AnnoyingCommand
extends org.bukkit.command.TabExecutor
| Modifier and Type | Method and Description |
|---|---|
default @NotNull java.util.function.Predicate<java.lang.String[]> |
getArgsPredicate()
OPTIONAL The command's arguments will be tested against this predicate |
default @NotNull java.lang.String |
getName()
OPTIONAL This is the name of the command |
default @Nullable java.lang.String |
getPermission()
OPTIONAL This is the permission required to use the command |
@NotNull AnnoyingPlugin |
getPlugin()
The
AnnoyingPlugin that this command belongs to |
default boolean |
isPlayerOnly()
OPTIONAL Whether the command is player-only (no console), default: false |
void |
onCommand(@NotNull AnnoyingSender sender)
REQUIRED This is everything that's executed when the command is run |
default boolean |
onCommand(@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull org.bukkit.command.Command cmd,
@NotNull java.lang.String label,
@NotNull java.lang.String[] args)
Executes the given command, returning its success.
|
default @Nullable java.util.Collection<java.lang.String> |
onTabComplete(@NotNull AnnoyingSender sender)
OPTIONAL This is the tab completion for the command |
default java.util.List<java.lang.String> |
onTabComplete(@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull org.bukkit.command.Command cmd,
@NotNull java.lang.String label,
@NotNull java.lang.String[] args)
Requests a list of possible completions for a command argument.
|
default void |
register()
Registers the command to the
getPlugin() |
default void |
unregister()
Unregisters the command from the
getPlugin() |
@NotNull @NotNull AnnoyingPlugin getPlugin()
AnnoyingPlugin that this command belongs to@NotNull default @NotNull java.lang.String getName()
OPTIONAL This is the name of the command
If not specified, the lowercase class name will be used (Command will be removed)
Example: the command class MyEpicCommand would be registered as myepic
@Nullable default @Nullable java.lang.String getPermission()
OPTIONAL This is the permission required to use the command
If not specified (or null), no permission will be required
default boolean isPlayerOnly()
OPTIONAL Whether the command is player-only (no console), default: false@NotNull default @NotNull java.util.function.Predicate<java.lang.String[]> getArgsPredicate()
OPTIONAL The command's arguments will be tested against this predicate
This is usually used to check if the command has the correct amount of arguments
If not specified, any arguments will be accepted
void onCommand(@NotNull
@NotNull AnnoyingSender sender)
REQUIRED This is everything that's executed when the command is runsender - the sender of the command@Nullable
default @Nullable java.util.Collection<java.lang.String> onTabComplete(@NotNull
@NotNull AnnoyingSender sender)
OPTIONAL This is the tab completion for the command
AnnoyingUtility will come in handy
sender - the sender of the commandCollection of suggestionsdefault void register()
getPlugin()default void unregister()
getPlugin()default boolean onCommand(@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull
@NotNull org.bukkit.command.Command cmd,
@NotNull
@NotNull java.lang.String label,
@NotNull
@NotNull java.lang.String[] args)
onCommand in interface org.bukkit.command.CommandExecutorcmdSender - Source of the commandcmd - Command which was executedlabel - Alias of the command which was usedargs - Passed command argumentsdefault java.util.List<java.lang.String> onTabComplete(@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull
@NotNull org.bukkit.command.Command cmd,
@NotNull
@NotNull java.lang.String label,
@NotNull
@NotNull java.lang.String[] args)
onTabComplete in interface org.bukkit.command.TabCompletercmdSender - Source of the command. For players tab-completing a command inside a command block, this will be the player, not the command block.cmd - Command which was executedlabel - Alias of the command which was usedargs - The arguments passed to the command, including final partial argument to be completed