Annotation Interface SubCommand


@Target(METHOD) @Retention(RUNTIME) public @interface SubCommand
Annotation for marking a method as a subcommand handler. Used to specify subcommand name, description, aliases, and permission requirement.
  • Element Details

    • name

      String name
      Subcommand name.
      Returns:
      the name of the subcommand
    • path

      String[] path
      Optional parent path segments for nested subcommands.
      Returns:
      parent path segments
      Default:
      {}
    • description

      String description
      Subcommand description.
      Returns:
      the description of the subcommand
      Default:
      ""
    • aliases

      String[] aliases
      Subcommand aliases.
      Returns:
      the aliases for the subcommand
      Default:
      {}
    • permission

      String permission
      Specific permission node required to execute the subcommand. If empty, no check is performed.
      Returns:
      permission node
      Default:
      ""
    • permissionDefault

      MagicPermissionDefault permissionDefault
      Default permission state (matches Bukkit PermissionDefault).
      Returns:
      default permission
      Default:
      OP
    • threading

      CommandThreading threading
      Threading policy for subcommand execution.
      Returns:
      threading policy
      Default:
      MAIN
    • merge

      How this node's execute is owned when several plugins contribute to the same command tree. Leaf sub-commands always accumulate; this only decides who owns the handler that runs when a player stops at this node. Defaults to MergePolicy.CONTRIBUTE (claim only if free — safe for shared roots).
      Returns:
      the merge policy for this node's execute
      Default:
      CONTRIBUTE