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

@Deprecated(since="2.17", forRemoval=true) public class ScriptCommand extends Object implements org.bukkit.command.TabExecutor
Deprecated, for removal: This API element is subject to removal in a future version.
There is no direct replacement for this class. The closest alternative is ScriptBrigadierCommand.
This class is used for user-defined commands.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScriptCommand(Script script, String name, String pattern, List<Argument<?>> arguments, String description, @Nullable String prefix, CommandUsage usage, List<String> aliases, String permission, @Nullable VariableString permissionMessage, @Nullable Timespan cooldown, @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable VariableString cooldownStorage, int executableBy, SectionNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new ScriptCommand.
    ScriptCommand(Script script, String name, String pattern, List<Argument<?>> arguments, String description, @Nullable String prefix, String usage, List<String> aliases, String permission, @Nullable VariableString permissionMessage, @Nullable Timespan cooldown, @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable VariableString cooldownStorage, int executableBy, SectionNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new ScriptCommand.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkPermissions(org.bukkit.command.CommandSender sender, String commandLabel, String arguments)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    checkPermissions(org.bukkit.command.CommandSender sender, org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    execute(org.bukkit.command.CommandSender sender, String commandLabel, String rest)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the arguments this command takes.
    org.bukkit.command.PluginCommand
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable Timespan
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    getElapsedMilliseconds(UUID uuid, org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable Date
    getLastUsage(UUID uuid, org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    getRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable Script
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    onCommand(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String label, @Nullable String[] args)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable List<String>
    onTabComplete(@Nullable org.bukkit.command.CommandSender sender, @Nullable org.bukkit.command.Command command, @Nullable String alias, @Nullable String[] args)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    register(org.bukkit.command.SimpleCommandMap commandMap, Map<String, org.bukkit.command.Command> knownCommands, @Nullable Set<String> aliases)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendHelp(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setElapsedMilliSeconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setLastUsage(UUID uuid, org.bukkit.event.Event event, @Nullable Date date)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    unregister(org.bukkit.command.SimpleCommandMap commandMap, Map<String, org.bukkit.command.Command> knownCommands, @Nullable Set<String> aliases)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PLAYERS

      public static final int PLAYERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • CONSOLE

      public static final int CONSOLE
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • BOTH

      public static final int BOTH
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Constructor Details

    • ScriptCommand

      public ScriptCommand(Script script, String name, String pattern, List<Argument<?>> arguments, String description, @Nullable @Nullable String prefix, String usage, List<String> aliases, String permission, @Nullable @Nullable VariableString permissionMessage, @Nullable @Nullable Timespan cooldown, @Nullable @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable @Nullable VariableString cooldownStorage, int executableBy, SectionNode node)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new ScriptCommand. Prefer using the CommandUsage class for the usage parameter.
      Parameters:
      name - /name
      pattern - the Skript pattern used to parse the input into arguments.
      arguments - the list of Arguments this command takes
      description - description to display in /help
      prefix - the prefix of the command
      usage - message to display if the command was used incorrectly
      aliases - /alias1, /alias2, ...
      permission - permission or null if none
      permissionMessage - message to display if the player doesn't have the given permission
      node - the node to parse and load into a Trigger
    • ScriptCommand

      public ScriptCommand(Script script, String name, String pattern, List<Argument<?>> arguments, String description, @Nullable @Nullable String prefix, CommandUsage usage, List<String> aliases, String permission, @Nullable @Nullable VariableString permissionMessage, @Nullable @Nullable Timespan cooldown, @Nullable @Nullable VariableString cooldownMessage, String cooldownBypass, @Nullable @Nullable VariableString cooldownStorage, int executableBy, SectionNode node)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new ScriptCommand.
      Parameters:
      name - /name
      pattern - the Skript pattern used to parse the input into arguments.
      arguments - the list of Arguments this command takes
      description - description to display in /help
      prefix - the prefix of the command
      usage - message to display if the command was used incorrectly
      aliases - /alias1, /alias2, ...
      permission - permission or null if none
      permissionMessage - message to display if the player doesn't have the given permission
      node - the node to parse and load into a Trigger
  • Method Details

    • onCommand

      public boolean onCommand(@Nullable @Nullable org.bukkit.command.CommandSender sender, @Nullable @Nullable org.bukkit.command.Command command, @Nullable @Nullable String label, @Nullable @Nullable String[] args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
    • execute

      public boolean execute(org.bukkit.command.CommandSender sender, String commandLabel, String rest)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • checkPermissions

      public boolean checkPermissions(org.bukkit.command.CommandSender sender, String commandLabel, String arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • checkPermissions

      public boolean checkPermissions(org.bukkit.command.CommandSender sender, org.bukkit.event.Event event)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendHelp

      public void sendHelp(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getArguments

      public List<Argument<?>> getArguments()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the arguments this command takes.
      Returns:
      The internal list of arguments. Do not modify it!
    • getPattern

      public String getPattern()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • register

      public void register(org.bukkit.command.SimpleCommandMap commandMap, Map<String, org.bukkit.command.Command> knownCommands, @Nullable @Nullable Set<String> aliases)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • unregister

      public void unregister(org.bukkit.command.SimpleCommandMap commandMap, Map<String, org.bukkit.command.Command> knownCommands, @Nullable @Nullable Set<String> aliases)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • registerHelp

      public void registerHelp()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • unregisterHelp

      public void unregisterHelp()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getName

      public String getName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPrefix

      public String getPrefix()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getLabel

      public String getLabel()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCooldown

      @Nullable public @Nullable Timespan getCooldown()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getLastUsage

      @Nullable public @Nullable Date getLastUsage(UUID uuid, org.bukkit.event.Event event)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setLastUsage

      public void setLastUsage(UUID uuid, org.bukkit.event.Event event, @Nullable @Nullable Date date)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getRemainingMilliseconds

      public long getRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setRemainingMilliseconds

      public void setRemainingMilliseconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getElapsedMilliseconds

      public long getElapsedMilliseconds(UUID uuid, org.bukkit.event.Event event)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setElapsedMilliSeconds

      public void setElapsedMilliSeconds(UUID uuid, org.bukkit.event.Event event, long milliseconds)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCooldownBypass

      public String getCooldownBypass()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAliases

      public List<String> getAliases()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getActiveAliases

      public List<String> getActiveAliases()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getBukkitCommand

      public org.bukkit.command.PluginCommand getBukkitCommand()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getScript

      @Nullable public @Nullable Script getScript()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onTabComplete

      @Nullable public @Nullable List<String> onTabComplete(@Nullable @Nullable org.bukkit.command.CommandSender sender, @Nullable @Nullable org.bukkit.command.Command command, @Nullable @Nullable String alias, @Nullable @Nullable String[] args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter