Annotation Interface Command


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface Command
Main class of the framework to create commands in easy way.
Since:
1.0.0
Author:
Despical
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Available command sender or senders.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the command.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    An alternative name list of command.
    boolean
    This option is now deprecated.
    The description of the command that will be showed when sender executes Bukkit's help command.
    By default, using the plugin's name as a fallback prefix.
    int
    Maximum value of arguments. -1 for infinite.
    int
    Minimum value of arguments.
    boolean
    Only op players can execute this command.
    The permission that sender has to have to execute command.
    Enum value of command sender type to define who will use the command.
    The usage of the command that will be showed when sender executes command without required or missing arguments.
  • Element Details

    • name

      String name
      The name of the command. If command would be a sub command then sub command's name must be separated by dot. For example like the "command.subcommand"
      Returns:
      name of the command or subcommand
    • fallbackPrefix

      String fallbackPrefix
      By default, using the plugin's name as a fallback prefix.
      Returns:
      a prefix which is prepended to the command with a ':' one or more times to make the command unique.
      Default:
      ""
    • permission

      String permission
      The permission that sender has to have to execute command.
      Returns:
      name of the permission
      Default:
      ""
    • aliases

      String[] aliases
      An alternative name list of command. Check name() to understand how command names work.
      Returns:
      aliases list of the command
      Default:
      {}
    • desc

      String desc
      The description of the command that will be showed when sender executes Bukkit's help command.
      Returns:
      description of the command
      Default:
      ""
    • usage

      String usage
      The usage of the command that will be showed when sender executes command without required or missing arguments.
      Returns:
      usage of the command.
      Default:
      ""
    • min

      int min
      Minimum value of arguments.
      Returns:
      minimum value of arguments.
      Default:
      0
    • max

      int max
      Maximum value of arguments. -1 for infinite.
      Returns:
      maximum value of arguments.
      Default:
      -1
    • onlyOp

      boolean onlyOp
      Only op players can execute this command.

      Permissions will be ignored if this option is enabled.

      Returns:
      allow only op players.
      Default:
      false
    • async

      boolean async
      This option is now deprecated. In newer versions of framework a new API will be introduced with additional features.

      This option makes command to execute in a separate thread but involves HIGH RISKS because the Bukkit API, except the scheduler package, is not thread safe nor guaranteed to be thread safe.

      Returns:
      asynchronous execution of command.
      Default:
      false
    • senderType

      Command.SenderType senderType
      Enum value of command sender type to define who will use the command.
      Returns:
      enum value of Command.SenderType
      Default:
      BOTH