public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(command.getName().equals("die")) {
if (sender instanceof Player) {
Player player = (Player) sender;
player.setHealth(0);
player.sendMessage(ChatColor.BLACK + "Death be upon you");
}
else{
System.out.println("Sorry this command is only for players in Minecraft.");
}
}
Command Arguments: Will allow you to add parameters to a command, therefore the command must follow a set of rules
e.g. the command must have a word inside of it otherwise it will return an error.