This project is a lightweight Paper/Bukkit plugin template. It is aimed at developers who want a clean starting point for Paper plugins, with preconfigured dependencies, a build setup, and two built-in command wrappers: a simple Bukkit command wrapper and a fluent builder for the CommandAPI.
public class HelloCommand {
public HelloCommand() {
CommandAPIWrapper.command(PaperPlugin.getInstance(), "hello")
.permission("paperplugin.command.hello")
.aliases("hey")
.execPlayer((player, args) -> player.sendRichMessage("<green>Hey " + player.getName() + "!"))
.execConsole((console, args) -> console.sendRichMessage("<green>Hello Console!"))
.sub("sub", c -> c
.execAny((sender, args) -> sender.sendRichMessage("<green>This is the /hello sub command!"))
).register();
}
}public final class HelloCommand extends BukkitCommand {
public HelloCommand() {
super("hello", "paperplugin.command.hello", "hey");
}
@Override
public void onCommand(@NotNull CommandSender sender, @NotNull String label, @NotNull String[] args) {
if (args.length == 0) {
if (sender instanceof Player player) {
player.sendRichMessage("<green>Hey " + player.getName() + "!");
} else {
sender.sendRichMessage("<green>Hello Console!");
}
return;
}
if (args[0].equalsIgnoreCase("world")) {
sender.sendRichMessage("<green>Hello, world!");
return;
}
sender.sendRichMessage("Usage: /" + label + " [world]");
}
}