-
Notifications
You must be signed in to change notification settings - Fork 0
Help
mario edited this page Mar 29, 2026
·
1 revision
@Help catches commands whose name starts with one of the given prefixes whenever
no better-matching @Command is found. It is typically used to show a list of
available subcommands when the root command is run alone.
| Property | Type | Description |
|---|---|---|
names |
String[] |
Prefixes to listen for. |
permission |
String |
Optional permission required to see the help message. |
public class FactionCommands {
@Command(names = {"f create", "faction create"}, permission = "plugin.faction.create", playerOnly = true)
public void create(Player sender, @Param(name = "name") String name) { ... }
@Command(names = {"f disband", "faction disband"}, permission = "plugin.faction.disband", playerOnly = true)
public void disband(Player sender) { ... }
// Triggered when /f or /faction is run with no recognizable subcommand.
@Help(names = {"f", "faction"})
public void help(CommandSender sender) {
sender.sendMessage("/f create <name> — Create a faction.");
sender.sendMessage("/f disband — Disband your faction.");
}
}When using @Subcommand, place @Help in the same class and list the root aliases:
@Subcommand(names = {"faction", "f"})
public class FactionCommands {
@Command(names = {"create"}, permission = "plugin.faction.create", playerOnly = true)
public void create(Player sender, @Param(name = "name") String name) { ... }
@Command(names = {"disband"}, permission = "plugin.faction.disband", playerOnly = true)
public void disband(Player sender) { ... }
@Help(names = {"faction", "f"})
public void help(CommandSender sender) {
sender.sendMessage("/f create <name> — Create a faction.");
sender.sendMessage("/f disband — Disband your faction.");
}
}- If no
@Helpis registered for a command, the framework falls back to an auto-generated usage message. -
@Helpworks identically on Bukkit, BungeeCord, and Velocity.