Skip to content

Creating commands

Hxncus edited this page Oct 8, 2024 · 2 revisions

Command registration

// Create our command
new SimpleCommand("broadcastmsg")
    .permission("broadcast")                                     // Required permissions
    .execute((sender, command, label, args) -> {
        String message = args.get(0, String.class, "MinesonAPI");
        Bukkit.getServer().broadcastMessage(message);
    })
    .register();

Clone this wiki locally