Plugin error's

Discussion in 'Plugin Development' started by IISeanII, Jun 24, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    So i have this error.. i made the errors red and underlined.. can anyone help me?

    here is a pastebin link

    package me.IISeanII.spakwarp;

    import java.util.logging.Logger;

    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginDescriptionFile;

    public class spakwarp extends JavaPlugin{
    public final Logger logger = Logger.getLogger("Minecraft");
    public static spakwarp plugin;

    PluginDescriptionFile pdfFile = this.getDescription();
    public final Location[] warpLocations = new Location[100];
    public final String[] warpName = new String[100];
    int warpCounter = 0;

    public void onDisable() { + " Has Been Disabled!");

    public void onEnable() {
    PluginDescriptionFile pdfFile = this.getDescription(); + " Version " + pdfFile.getVersion() + " Has Been Enabled!");

    public boolean onCommand(CommandSender sender, Command cmd,
    String commandLabel, String[] args){
    Player player = (Player) sender;
    if(args.length ==0){
    player.sendMessage(ChatColor.RED + "/setswarp <swarpname>");
    Location location = player.getLocation();
    if(!(warpCounter > 100)){
    warpLocations[warpCounter] = location;
    warpName[warpCounter] = args[0];
    player.sendMessage(ChatColor.GREEN + "Swarp Set As: " + args[0]);
    player.sendMessage(ChatColor.RED+"Swarp Limit Exceeded! Unable To Create Warp!");

    } else if(commandLabel.equalsIgnoreCase("swarp")){
    for(int i = 0; i < warpName.length; i++){
    String warpname = warpName;
    Location warpLocation = warpLocations;
    player.sendMessage(ChatColor.GREEN +"You are now at "
    + warpName);
    } else if(commandLabel.equalsIgnoreCase("swarp list")){
    String warps = "";
    for(int i = 0; i <warpName.length; i++){
    if(i != warpName.length){
    warps+=warpName + ", ".replace("Null", "");
    player.sendMessage(ChatColor.DARK_GRAY + "Swarps List: " + ChatColor.DARK_GRAY );
  2. Offline


    You are missing two closing brackets at the end.

    The error for equalsIgnoreCase is due to the fact that you are trying to compare a String to an array of Strings...I think what you want is
    But naming two variables so similarly should be avoided
Thread Status:
Not open for further replies.

Share This Page