Class HelpFormatter

java.lang.Object
net.blockhost.commons.commands.help.HelpFormatter

public final class HelpFormatter extends Object

Formats and sends help messages for commands.

This class uses MiniMessage formatting to display help information based on the provided HelpConfig configuration.

Example Usage

HelpFormatter formatter = new HelpFormatter(helpConfig);
formatter.sendHelp(player, List.of(
    new CommandEntry("spawn", "Teleport to spawn"),
    new CommandEntry("home", "Teleport to your home")
));
  • Constructor Details

    • HelpFormatter

      public HelpFormatter(HelpConfig config)
      Creates a new help formatter with the given configuration.
      Parameters:
      config - the help configuration
  • Method Details

    • sendHelp

      public void sendHelp(Audience audience, List<HelpFormatter.CommandEntry> commands)
      Sends a help message to the given audience.
      Parameters:
      audience - the audience to send the help to
      commands - the list of commands to display
    • sendMockHelp

      public void sendMockHelp(Audience audience)
      Sends a mock help message for testing purposes.
      Parameters:
      audience - the audience to send the help to