Skip to main content
Command-level annotations control the behavior, visibility, and metadata of your commands.

@Command

Marks a method or class as a command.
value
String[]
required
Command labels (aliases). The first label is used as the primary name in help messages.

Usage Patterns

  • Method-level: Registers the method as a standalone command
  • Class-level: Acts as a prefix for all command methods within the class
@Command("heal")
public void healCommand(@Sender Player player) {
    player.setHealth(20.0);
    player.sendMessage("You have been healed!");
}

@Description

Sets the description displayed in help messages.
value
String
The command description text.
@Command("heal")
@Description("Restore your health to full")
public void healCommand(@Sender Player player) {
    player.setHealth(20.0);
}

@Permission

Requires permission to execute the command.
value
String
default:""
The required permission node. Special values:
  • op - Requires operator status
  • console - Requires console sender
  • @predicate - Custom permission predicate (prefix with @)
message
String
default:""
Custom message shown when permission is denied. Falls back to the global default if not set.
@Command("ban")
@Permission("server.admin.ban")
public void banCommand(@Sender Player player, @Name("target") Player target) {
    target.kickPlayer("You have been banned");
}

@Hidden

Hides a command from help messages and tab completion.
@Command("secret")
@Hidden
public void secretCommand(@Sender Player player) {
    // Won't appear in /help or tab completion
    // Shows "unknown command" instead of "no permission"
}
Hidden commands still execute normally if the exact name is typed. They just don’t appear in discovery features.

@Async

Executes the command asynchronously on a separate thread.
@Command("lookup")
@Async
public void lookupCommand(@Sender Player player, @Name("username") String username) {
    // This runs on a background thread
    UUID uuid = fetchUUIDFromAPI(username);
    player.sendMessage("UUID: " + uuid);
}
Be careful when modifying game state from async commands. Use your platform’s scheduler to sync back to the main thread when needed.

@Help

Marks a command as a help command that displays generated help messages.
@Command("help")
@Help
public void helpCommand() {
    // Method body is ignored
    // Blade generates and displays help automatically
}

@Command("admin")
public class AdminCommands {
    @Command("help")
    @Help
    public void help() {
        // Shows help for all admin subcommands
    }
    
    @Command("ban")
    public void ban(@Sender Player player, @Name("target") Player target) {}
}

@Usage

Sets a custom usage message for the command.
value
String
Custom usage text. If not specified, Blade generates usage automatically from parameters.
@Command("teleport")
@Usage("/teleport <player> [world]")
public void teleportCommand(
    @Sender Player sender,
    @Name("player") Player target,
    @Name("world") @Opt World world
) {
    // Custom usage overrides auto-generated format
}

@ExtraUsage

Appends additional text to the end of the generated usage message.
value
String
Text to append to the usage message.
@Command("spawn")
@ExtraUsage("Use -f to force teleport")
public void spawnCommand(@Sender Player player, @Flag('f') boolean force) {
    // Usage: /spawn [-f] Use -f to force teleport
}

@MainLabel

Sets the main label displayed in usage messages and help.
value
String
The label to use. If not set, the first alias from @Command is used.
@Command({"tp", "teleport", "warp"})
@MainLabel("teleport")
public void teleportCommand(@Sender Player player) {
    // Usage messages show "/teleport" instead of "/tp"
}

@Quoted

Enables quote parsing for command arguments.
@Command("say")
@Quoted
public void sayCommand(@Sender Player player, @Name("message") String message) {
    // /say "hello world" -> message = "hello world"
    // /say hello world -> message = "hello"
    player.sendMessage(message);
}
When applied to a method, all parameters support quote parsing. When applied to a parameter, only that parameter supports quotes.

Build docs developers (and LLMs) love