/warp, /warpset, /warpdelete, you can have /warp create, /warp delete, /warp list.
Understanding Subcommands
Blade supports two ways to create subcommands:- Inline method syntax - Define the full command path in
@Command - Class-level prefix - Use
@Commandon a class to prefix all methods
Inline Subcommands
The simplest way to create subcommands is to include the full path in the@Command annotation:
/warp list- Lists warps/warp create <name>- Creates a warp/warp delete <name>- Deletes a warp/warp <name>- Teleports to a warp
Class-Level Command Prefix
Use@Command on the class itself to prefix all methods:
@Command("warp")on the class acts as a prefix- Each method’s
@Commandis appended to the prefix - Empty
@Commandon a method uses just the class prefix
Multi-Level Subcommands
Create deep command hierarchies:/admin player ban <player> <reason>- Ban a player/admin player kick <player> [reason]- Kick a player/admin server restart [delay]- Restart server/admin server maintenance -o|-f- Toggle maintenance
Organizing by Feature
Group related functionality into separate classes: Final command structure:/economy balance [player]- Check balance/economy pay <player> <amount>- Send money/economy admin give <player> <amount>- Give money (admin)/economy admin take <player> <amount>- Take money (admin)/economy admin set <player> <amount>- Set balance (admin)
Command Aliases
Support multiple command names:/warp list,/warps list,/w list/warp ls,/w ls/warp create home,/w add home,/warps new home
Base Command with Subcommands
Create a default action when the base command is used alone:/shop- Opens GUI/shop buy diamond 10- Buys 10 diamonds/shop sell -a- Sells all items
Best Practices
1. Keep Related Commands Together
2. Use Consistent Naming
3. Organize by Permission Level
Next Steps
- Basic Commands - Learn the fundamentals
- Complex Commands - Advanced features
- Custom Types - Create custom argument providers