Class StructCommand

java.lang.Object
org.skriptlang.skript.lang.structure.Structure
org.skriptlang.skript.bukkit.command.elements.structures.StructCommand
All Implemented Interfaces:
Debuggable, SyntaxElement

@Name("Command") @Description("Used for registering custom commands.") @Example("command /broadcast <string>:\n\taliases: /bc\n\texecutable by: players and console\n\tusage: A command for broadcasting a message to all players.\n\tpermission: skript.command.broadcast\n\tcooldown: 15 seconds\n\tcooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%.\n\tcooldown bypass: skript.command.broadcast.admin\n\tcooldown storage: {cooldown::%player%}\n\ttrigger:\n\t\tbroadcast the argument\n") @Example("command /home:\n\tsubcommand set <name: text>:\n\t\ttrigger:\n\t\t\tset {homes::%player%::%{_name}%} to the player's location\n\tsubcommand <name: text>:\n\t\tsuggestions:\n\t\t\tloop {homes::%player%::*}:\n\t\t\t\tadd formatted \"<ttp:'Location: %loop-value%'>%loop-index%\" to the suggestions for the text argument\n\t\ttrigger:\n\t\t\tteleport the player to {homes::%player%::%{_name}%}\n") @Since({"1.0","2.17 (subcommands, suggestions, etc.)"}) public class StructCommand extends Structure
  • Constructor Details

    • StructCommand

      public StructCommand()
  • Method Details

    • register

      public static void register(SkriptAddon addon, SyntaxRegistry syntaxRegistry)
    • init

      public boolean init(Literal<?>[] args, int matchedPattern, SkriptParser.ParseResult parseResult, EntryContainer entryContainer)
      Description copied from class: Structure
      The initialization phase of a Structure. Typically, this should be used for preparing fields (e.g. handling arguments, parse tags) Logic such as trigger loading should be saved for a loading phase (e.g. Structure.load()).
      Specified by:
      init in class Structure
      Parameters:
      args - The arguments of the Structure.
      matchedPattern - The matched pattern of the Structure.
      parseResult - The parse result of the Structure.
      entryContainer - The EntryContainer of the Structure. Will not be null if the Structure provides a EntryValidator.
      Returns:
      Whether initialization was successful.
    • load

      public boolean load()
      Description copied from class: Structure
      The second phase of Structure loading. During this phase, all Structures across all loading scripts are loaded with respect to their priorities.
      Specified by:
      load in class Structure
      Returns:
      Whether loading was successful. An error should be printed prior to returning false to specify the cause.
    • postLoad

      public boolean postLoad()
      Description copied from class: Structure
      The third and final phase of Structure loading. During this phase, all Structures across all loading scripts are loaded with respect to their priorities. This method is primarily designed for Structures that wish to execute actions after most other Structures have finished loading.
      Overrides:
      postLoad in class Structure
      Returns:
      Whether postLoading was successful. An error should be printed prior to returning false to specify the cause.
    • unload

      public void unload()
      Description copied from class: Structure
      Called when this structure is unloaded.
      Overrides:
      unload in class Structure
    • postUnload

      public void postUnload()
      Description copied from class: Structure
      Called when this structure is unloaded. This method is primarily designed for Structures that wish to execute actions after most other Structures have finished unloading.
      Overrides:
      postUnload in class Structure
    • toString

      public String toString(@Nullable @Nullable org.bukkit.event.Event event, boolean debug)
      Parameters:
      event - The event to get information from. This is always null if debug == false.
      debug - If true this should print more information, if false this should print what is shown to the end user
      Returns:
      String representation of this object