Annotation Type Command


@Retention(RUNTIME) public @interface Command
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    A list of root-level command aliases that will be accepted for this command.
    A short description of the command that will be displayed with the command usage and help.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the flags available for this command.
    A longer description of the command and any flags it uses which will be displayed in addition to desc() in help commands.
    int
    The maximum number of arguments that the command will accept.
    int
    Minimum number of arguments that are accepted by the command.
    The argument modifiers accepted by the command.
    boolean
    Whether to parse placeholders from the input command.
    The permission of the command.
    boolean
    Whether a flag or value flag MUST be used for this command.
    Command usage string that is displayed when an error occurs with the command processing.
    List of value flags (without --).
  • Element Details

    • aliases

      String[] aliases
      A list of root-level command aliases that will be accepted for this command. For example: {"npc", "npc2"} would match both /npc and /npc2.
    • desc

      String desc
      A short description of the command that will be displayed with the command usage and help. Translatable.
    • flags

      String flags
      Defines the flags available for this command. A flag is a single character such as -f that will alter the behaviour of the command. Each character in this string will be counted as a valid flag: extra flags will be discarded. Accepts * as a catch all.
      Default:
      ""
    • help

      String help
      A longer description of the command and any flags it uses which will be displayed in addition to desc() in help commands. Translatable.
      Default:
      ""
    • max

      int max
      The maximum number of arguments that the command will accept. Default is -1, or an unlimited number of arguments.
      Default:
      -1
    • min

      int min
      Minimum number of arguments that are accepted by the command.
      Default:
      0
    • modifiers

      String[] modifiers
      The argument modifiers accepted by the command. Also accepts '*' as a catch all.
      Default:
      {""}
    • parsePlaceholders

      boolean parsePlaceholders
      Whether to parse placeholders from the input command.
      Default:
      false
    • permission

      String permission
      The permission of the command. The comamnd sender will get an error if this is not met.
      Default:
      ""
    • requiresFlags

      boolean requiresFlags
      Whether a flag or value flag MUST be used for this command.
      Default:
      false
    • usage

      String usage
      Command usage string that is displayed when an error occurs with the command processing.
      Default:
      ""
    • valueFlags

      String[] valueFlags
      List of value flags (without --).
      Default:
      {}