Hey guys , the last } is red underlined and i don't see why, can anyone help ? Code:java package com.saicogaming; import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Material;import org.bukkit.command.Command;import org.bukkit.command.CommandExecutor;import org.bukkit.command.CommandSender;import org.bukkit.enchantments.Enchantment;import org.bukkit.entity.Player;import org.bukkit.inventory.ItemStack; public class StartCommandExecutor implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (cmd.getName().equalsIgnoreCase("enchant")) { // Make sure that the player specified exactly one argument (the name of the player to give enchanted item too). if (args.length != 1) { // When onCommand() returns false, the help message associated with that command is displayed. return false; } // Make sure the send is a player. if (!(sender instanceof Player)) { sender.sendMessage("Only players another player an item"); sender.sendMessage("This is an arbitrary requirement for demonstration purposes only."); return true; } // Get the player who should be set on fire. Remember that indecies start with 0, not 1. Player target = Bukkit.getServer().getPlayer(args[0]); // Make sure the player is online. if (target == null) { sender.sendMessage(args[0] + " is not currently online."); return true; } ItemStack item = new ItemStack(Material.DIAMOND_SWORD); item.addEnchantment( Enchantment.DAMAGE_ALL , 100); target.getInventory().addItem(item); sender.sendMessage(ChatColor.BLUE + "[Enchantment]" + ChatColor.RED + args[0] + "Here is a Diamond Sword, Enchanted with Sharpness 100"); return true; } return false; if (cmd.getName().equalsIgnoreCase("ignite")) { // Make sure that the player specified exactly one argument (the name of the player to ignite). if (args.length != 1) { // When onCommand() returns false, the help message associated with that command is displayed. return false; } // Make sure the sender is a player. if (!(sender instanceof Player)) { sender.sendMessage("Only players can set other players on fire."); sender.sendMessage("This is an arbitrary requirement for demonstration purposes only."); return true; } // Get the player who should be set on fire. Remember that indecies start with 0, not 1. Player target = Bukkit.getServer().getPlayer(args[0]); // Make sure the player is online. if (target == null) { sender.sendMessage(args[0] + " is not currently online."); return true; } // Sets the player on fire for 1,000 ticks (there are ~20 ticks in second, so 50 seconds total). target.setFireTicks(1000); target.setAllowFlight(true); return true; } return false; }
ยง This whole part get a red line under it! Code:java if (cmd.getName().equalsIgnoreCase("ignite")) {// Make sure that the player specified exactly one argument (the name of the player to ignite).if (args.length != 1) {// When onCommand() returns false, the help message associated with that command is displayed.return false;} // Make sure the sender is a player.if (!(sender instanceof Player)) {sender.sendMessage("Only players can set other players on fire.");sender.sendMessage("This is an arbitrary requirement for demonstration purposes only.");return true;} // Get the player who should be set on fire. Remember that indecies start with 0, not 1.Player target = Bukkit.getServer().getPlayer(args[0]); // Make sure the player is online.if (target == null) {sender.sendMessage(args[0] + " is not currently online.");return true;} // Sets the player on fire for 1,000 ticks (there are ~20 ticks in second, so 50 seconds total).target.setFireTicks(1000);target.setAllowFlight(true);return true;}return false;}} EDIT - i added a Else if in there and the error went, is this correct way to do this? Code:java package com.saicogaming; import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Material;import org.bukkit.command.Command;import org.bukkit.command.CommandExecutor;import org.bukkit.command.CommandSender;import org.bukkit.enchantments.Enchantment;import org.bukkit.entity.Player;import org.bukkit.inventory.ItemStack; public class StartCommandExecutor implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (cmd.getName().equalsIgnoreCase("enchant")) { // Make sure that the player specified exactly one argument (the // name of the player to give enchanted item too). if (args.length != 1) { // When onCommand() returns false, the help message associated // with that command is displayed. return false; } // Make sure the send is a player. if (!(sender instanceof Player)) { sender.sendMessage("Only players another player an item"); sender.sendMessage("This is an arbitrary requirement for demonstration purposes only."); return true; } // Get the player who should be set on fire. Remember that indecies // start with 0, not 1. Player target = Bukkit.getServer().getPlayer(args[0]); // Make sure the player is online. if (target == null) { sender.sendMessage(args[0] + " is not currently online."); return true; } ItemStack item = new ItemStack(Material.DIAMOND_SWORD); item.addEnchantment(Enchantment.DAMAGE_ALL, 100); target.getInventory().addItem(item); sender.sendMessage(ChatColor.BLUE + "[Enchantment]" + ChatColor.RED + args[0] + "Here is a Diamond Sword, Enchanted with Sharpness 100"); return true; }else if (cmd.getName().equalsIgnoreCase("ignite")) { // Make sure that the player specified exactly one argument (the // name of the player to ignite). if (args.length != 1) { // When onCommand() returns false, the help message associated // with that command is displayed. return false; } // Make sure the sender is a player. if (!(sender instanceof Player)) { sender.sendMessage("Only players can set other players on fire."); sender.sendMessage("This is an arbitrary requirement for demonstration purposes only."); return true; } // Get the player who should be set on fire. Remember that indecies // start with 0, not 1. Player target = Bukkit.getServer().getPlayer(args[0]); // Make sure the player is online. if (target == null) { sender.sendMessage(args[0] + " is not currently online."); return true; } // Sets the player on fire for 1,000 ticks (there are ~20 ticks in // second, so 50 seconds total). target.setFireTicks(1000); target.setAllowFlight(true); return true; } return false; }}