@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("basic")) { // If the player typed /basic then do the following...
//check the amount of values in the array
if (args.length == 0){
//no arguments
return false;
}
//send the first value from the array
sender.sendMessage("First argument: " + args[0]);
return true;
} else if (cmd.getName().equalsIgnoreCase("basic2")) {
//command is now the same as the one checked ^ (basic2)
String command = cmd.getName();
//for every argument, add it to the command
for (String arg : args){
command += " " + arg;
}
//send entire command as message
sender.sendMessage("Entire command: " + command);
return true;
}
return false;
}
Comments
0 B
|👍
/👎