Skip to content

DRSchlaubi/kaesk

Repository files navigation

even-more-simple-spigot-command-thingy

Demo video

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

Usage

Make a command.

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

Sub command

@Command(name = "sub")
public void subCommand(Player player) {
  // because console is not allowed first argument ist auto-casted to player
}

NSub command

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

Modules

For more information take a look at the example here

Javadoc

The very urgly javadoc (thx oracle) fancy kdoc (thx jetbrains) can be found here

Download

Please download from Modules

Credits

Thanks to Paul2708 for creating simple-commands as I kinda copyed his idea.

Thanks to mgvpri for doing something simmilar in his stream