Skip to content

Command Flags

Mazen edited this page Apr 16, 2023 · 2 revisions

Command Flags

Flags are specific characters that start with '-' and can be used to modify the execution of the command syntax

Creating and registering your own flags

commandManager.flagRegistry().registerFlag(
				FlagInfo.builder("silent")
				.info(new Information("flag.silent", "Silently do things !"))
				.aliases("s", "sN")
				.build());

First parameter in info() is the permission of the flag, while the second one is for the description of the flag

You can specify an alias of the flag which will be used to detect the usage of that flag.