What's wrong here?: Code (Text): package project.gui.test; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; public class GUI extends JavaPlugin implements Listener { public void onEnable() { getServer().getPluginManager().registerEvents(this, this); public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) { Player player = (Player) sender; if(commandLabel.equalsignoreCase("SetStart")){ if(args.length == 0){ player.sendMessage(ChatColor.RED + "/setStart "); } else { Location location = player.getLocation(); if (!(StartCounter > 1)){ StartLocation[StartCounter] = location; StartNames[StartCounter] args[0]; StartCounter++; player.sendMessage(ChatColor.GREEN + "Start Set As: " + args [0]); }else{ player.sendMessage (ChatColor.RED + "There Are Enough Starts, no more needed!"); } } }else if(commandName.equalIgnoreCase("TeleStart")) { for (int i = 0; i < warpNames.lenght; i++) { String warpName = warpName[i]; if (args [0].equalsIgnoreCase(StartName)) { Location warpLocation = warpLocation[i]; player.teleport(StartLocation); player.sendMessage(ChatColor.DARK_GREEN + "teleported To " + StartName); break; } } }else if (commandLabel.equalignoreCase("SeeStarts")) String Starts = ""; for (int i = 0; i < StartNames.lenght; i++){ if (i != warpNames.lenght){ warps += warpNames[i] + ",".reaplace("null",""); }else{ player.sendMessage(ChatColor.DARK_GRAY + "Showing The Starts:" + ChatColor.GRAY + starts); } } } } } THANKS Please, don't be rude, I know I'm noob
ERRORS 1st Code (Text): 7 Syntax errors+ illegal modifier + invalid args: public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) { 2nd Code (Text): Syntax error (AssignmentOperator expected) StartNames[StartCounter] args[0]; 3rd Code (Text): Syntax error (Identifier or new, insert ';' , "AssignmentOperator Expression" to complete Assignment): String Starts = "";
I would strongly recommend using an IDE like Eclipse. One of the benefits of programming in a strongly-typed language like Java is there are tools that tell you ahead of time about syntax errors.