spigot multi arg command code example
Example: spigot multi arg command
public class CommandName implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length < 1) {
Util.sendtoplayer((Player) sender, "$cInvalid amount of args");
}
if (args[0].equals("subcommandname")) {
//do stuff
} else if (args[0].equals("othersubcommandname")) {
//do more things
}
return true;
}
}