Class HelpFormatter
java.lang.Object
net.blockhost.commons.commands.help.HelpFormatter
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")
));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a command entry in the help listing. -
Constructor Summary
ConstructorsConstructorDescriptionHelpFormatter(HelpConfig config) Creates a new help formatter with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendHelp(Audience audience, List<HelpFormatter.CommandEntry> commands) Sends a help message to the given audience.voidsendMockHelp(Audience audience) Sends a mock help message for testing purposes.
-
Constructor Details
-
HelpFormatter
Creates a new help formatter with the given configuration.- Parameters:
config- the help configuration
-
-
Method Details
-
sendHelp
Sends a help message to the given audience.- Parameters:
audience- the audience to send the help tocommands- the list of commands to display
-
sendMockHelp
Sends a mock help message for testing purposes.- Parameters:
audience- the audience to send the help to
-