This is a very simple Spigot command parser
Info This library only works when using java 14+ and at least this PaperMC build (#229) because of some wierd bugs in spigot code Only for 1.1 and prior
Make a command.
@CommandClass(name = "gamemode", permission = "plugin.gamemode")
public class GameModeCommand {
@Command(root = true, consoleAllowed = true)
public void rootCommand(CommandSender sender) {
sender.sendMessage("Usage: /gamemode <mode> <player>");
}
}
@Command(name = "sub")
public void subCommand(Player player) {
// because console is not allowed first argument ist auto-casted to player
}
@CommandParents({"sub"})
@Command(name = "sub")
public void subCommand(Player player, @CommandParameter(name = "playerName") String playerName) {
// parameter names get discarded at compile time so you can use an annotations
}
For more information take a look at the example here
The very urgly javadoc (thx oracle) fancy kdoc (thx jetbrains) can be found here
Please download from Modules
Thanks to Paul2708 for creating simple-commands as I kinda copyed his idea.
Thanks to mgvpri for doing something simmilar in his stream