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
-
Constructor Summary
ConstructorDescriptionScriptCommand(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 TypeMethodDescriptionboolean
Gets the arguments this command takes.org.bukkit.command.PluginCommand
@Nullable Timespan
long
getElapsedMilliseconds(UUID uuid, org.bukkit.event.Event event)
getLabel()
@Nullable Date
getLastUsage(UUID uuid, org.bukkit.event.Event event)
getName()
long
getRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event)
@Nullable File
boolean
onCommand(@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)
void
register(org.bukkit.command.SimpleCommandMap commandMap, Map<String,org.bukkit.command.Command> knownCommands, @Nullable Set<String> aliases)
void
void
sendHelp(org.bukkit.command.CommandSender sender)
void
setElapsedMilliSeconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
void
setLastUsage(UUID uuid, org.bukkit.event.Event event, @Nullable Date date)
void
setRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
void
unregister(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:
onCommand
in 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:
onTabComplete
in interfaceorg.bukkit.command.TabCompleter
-