[Basic Help] Errors.

Discussion in 'Plugin Development' started by PokeNet, Mar 10, 2014.

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

    PokeNet

    So I only started coding today, and have been following some tutorials.

    I got the jist of this healing plugin, but Eclipse says there are 3 errors.
    Image of errors: http://gyazo.com/1fca8feedbfb5622a581bd43d4e4d7ed

    Code;
    Code:java
    1. package me.pokenet.youtube;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import org.bukkit.ChatColor;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9. import org.bukkit.plugin.PluginDescriptionFile;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class Youtube extends JavaPlugin{
    13. public final Logger logger = Logger.getLogger("Minecraft");
    14. public static Youtube plugin;
    15.  
    16. @Override
    17. public void onDisable() {
    18. PluginDescriptionFile pdfFile = this.getDescription();
    19. this.logger.info(pdfFile.getName() + " Has Been Disabled!");
    20. }
    21.  
    22. @Override
    23. public void onEnable() {
    24. PluginDescriptionFile pdfFile = this.getDescription();
    25. this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + "Has Been Enabled!");
    26. }
    27.  
    28. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    29. Player player = (Player) sender;
    30.  
    31. if(commandLabel.equalsIgnoreCase("heal") || commandLabel.equalsIgnoreCase("h")){
    32. if(args.length == 0){
    33. player.setHealthScale(20);
    34. player.sendMessage(ChatColor.BLUE + "Healed!");
    35. }else if(args.length == 1){
    36. Player targetPlayer = player.getServer().getPlayer(args[0]);
    37. targetPlayer.setHealthScale(20);
    38. player.sendMessage(ChatColor.BLUE + "Healed!");
    39.  
    40. }
    41. }
    42. return false;
    43. }
    44. }
    45.  


    It has something too do with the } Under "Has Been Enabled" And under "Return False;

    Thanks!
     
  2. Offline

    Mmarz11

    PokeNet Eclipse isn't giving any errors for me. Did you save the class? The Problems tab updates when you save it.
     
  3. Offline

    KaiPol

    You can try to run it anyways, sometimes I get errors even though it works. And then the errors are removed :L
     
Thread Status:
Not open for further replies.

Share This Page