Skip to content
mario edited this page Mar 29, 2026 · 1 revision

Help

@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.

@Help Reference

Property Type Description
names String[] Prefixes to listen for.
permission String Optional permission required to see the help message.

Example

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.");
    }
}

With @Subcommand

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.");
    }
}

Notes

  • If no @Help is registered for a command, the framework falls back to an auto-generated usage message.
  • @Help works identically on Bukkit, BungeeCord, and Velocity.

Clone this wiki locally