Package ch.njol.skript.command
Class ScriptCommand
java.lang.Object
ch.njol.skript.command.ScriptCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor
This class is used for user-defined commands.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScriptCommand(File script, String name, String pattern, List<Argument<?>> arguments, String description, String usage, ArrayList<String> aliases, String permission, @Nullable VariableString permissionMessage, @Nullable Timespan cooldown, @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable VariableString cooldownStorage, int executableBy, List<TriggerItem> items)Creates a new SkriptCommand. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the arguments this command takes.org.bukkit.command.PluginCommand@Nullable TimespanlonggetElapsedMilliseconds(UUID uuid, org.bukkit.event.Event event)getLabel()@Nullable DategetLastUsage(UUID uuid, org.bukkit.event.Event event)getName()longgetRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event)@Nullable FilebooleanonCommand(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String label, @Nullable String[] args)onTabComplete(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String alias, @Nullable String[] args)voidregister(org.bukkit.command.SimpleCommandMap commandMap, Map<String,org.bukkit.command.Command> knownCommands, @Nullable Set<String> aliases)voidvoidsendHelp(org.bukkit.command.CommandSender sender)voidsetElapsedMilliSeconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)voidsetLastUsage(UUID uuid, org.bukkit.event.Event event, @Nullable Date date)voidsetRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)voidunregister(org.bukkit.command.SimpleCommandMap commandMap, Map<String,org.bukkit.command.Command> knownCommands, @Nullable Set<String> aliases)void
-
Field Details
-
m_executable_by_players
-
m_executable_by_console
-
PLAYERS
public static final int PLAYERS- See Also:
- Constant Field Values
-
CONSOLE
public static final int CONSOLE- See Also:
- Constant Field Values
-
BOTH
public static final int BOTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
ScriptCommand
public ScriptCommand(File script, String name, String pattern, List<Argument<?>> arguments, String description, String usage, ArrayList<String> aliases, String permission, @Nullable VariableString permissionMessage, @Nullable Timespan cooldown, @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable VariableString cooldownStorage, int executableBy, List<TriggerItem> items)Creates a new SkriptCommand.- Parameters:
name- /namepattern-arguments- the list of Arguments this command takesdescription- description to display in /helpusage- message to display if the command was used incorrectlyaliases- /alias1, /alias2, ...permission- permission or null if nonepermissionMessage- message to display if the player doesn't have the given permissionitems- trigger to execute
-
-
Method Details
-
onCommand
public boolean onCommand(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String label, @Nullable String[] args)- Specified by:
onCommandin interfaceorg.bukkit.command.CommandExecutor
-
execute
-
sendHelp
public void sendHelp(org.bukkit.command.CommandSender sender) -
getArguments
Gets the arguments this command takes.- Returns:
- The internal list of arguments. Do not modify it!
-
getPattern
-
register
-
unregister
-
registerHelp
public void registerHelp() -
unregisterHelp
public void unregisterHelp() -
getName
-
getLabel
-
getCooldown
-
getLastUsage
-
setLastUsage
-
getRemainingMilliseconds
-
setRemainingMilliseconds
-
getElapsedMilliseconds
-
setElapsedMilliSeconds
-
getCooldownBypass
-
getAliases
-
getActiveAliases
-
getBukkitCommand
public org.bukkit.command.PluginCommand getBukkitCommand() -
getScript
-
onTabComplete
public @Nullable List<String> onTabComplete(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String alias, @Nullable String[] args)- Specified by:
onTabCompletein interfaceorg.bukkit.command.TabCompleter
-