You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
So what we have now for the CommandBuilder class is quite literally nothing important, it is basically the exact same as the CommandExecutor class.
So, I was thinking of something like this:
Without Arguments:
CommandBuildercmd = newCommandBuilder("test")
.setPermission("test.command")
.setUsage("Correct Usage: /<command>")
.setDescription("This command is a test. This is also shown in /help testcommand")
.setShortDescription("This is a short description shown in /help testcommand")
.setAliases("testcommand")
.addAlias("testing")
.setExecutor((CommandSendersender, CommandArgumentsargs) -> {
sender.sendMessage("Just some random implementation.");
return;
})
.register();
With Arguments:
CommandBuildercmd = newCommandBuilder("broadcast")
.setArguments(newJoinedStringArgument(0)) // Special characters can be used and can have spaces.
.setPermission("broadcast.command")
.setUsage("Correct Usage: /<command> <message>")
.setDescription("Broadcasts the message set in the arguments of the command.")
.setShortDescription("Broadcasts a message.")
.setAliases("bc")
.addAlias("broadcastmsg")
.setExecutor((CommandSendersender, CommandArgumentsargs) -> {
if (args.get(0) == null) {
sender.sendMessage("Correct Usage: /broadcast <message>")
returntrue;
}
Bukkit.broadcastMessage("BROADCAST: " + args.get(0));
returntrue;
})
.register();
So what we have now for the CommandBuilder class is quite literally nothing important, it is basically the exact same as the CommandExecutor class.
So, I was thinking of something like this: