Bukkit coding

Discussion in 'Plugin Development' started by Ahobo30, Mar 8, 2013.

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

    Ahobo30

    I just decided to try some bukkit coding. I am however following an old tutorial that does not work with the Bukkit event handling system. So after a waste of a few hours I come here looking for any help i can get.
    I am posting the full code just to not cause any issues...

    Code (Text):
    1. package com.minenamic.bukkit.SuperPick;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import org.bukkit.event.Event;
    6. import org.bukkit.event.EventPriority;
    7. import org.bukkit.plugin.PluginDescriptionFile;
    8. import org.bukkit.plugin.java.JavaPlugin;
    9.  
    10. public class SuperPick extends JavaPlugin {
    11.  
    12.     private Logger log = Logger.getLogger("Minecraft");
    13.     public void onEnable(){
    14.         @EventHandler(priority = EventPriority.NORMAL) {
    15.         this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_INTERACT, l, Event.Priority.Normal, this);
    16.         this.logMessage("Enabled.");
    17.     }
    18.      
    19.     }
    20.  
    21.     public void onDisable(){
    22.         this.logMessage("Disabled.");
    23.      
    24.     }
    25.  
    26.     public void logMessage (String msg){
    27.         PluginDescriptionFile pdFile = this.getDescription();
    28.         this.log.info(pdFile.getName() + " " + pdFile.getVersion() + ": " + msg);
    29.      
    30.     }
    31.  
    32. }
    33.  
    I keep getting these issues:
    Syntax error, insert "EnumBody" to complete BlockStatementsSuperPick.java
    Syntax error, insert "enum Identifier" to complete EnumHeaderNameSuperPick.java
     
  2. Offline

    c0mp

    Moved to Plugin Development!
     
  3. well for one remove your eventhandeler from your onEnable().

    2nd watch this video:
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    If the tutorial tells you to get the Logger "Minecraft" it is bad and you should not follow that tutorial.
     
    drtshock and Tirelessly like this.
  5. Offline

    coobro123

    you should probably start on a command.
     
Thread Status:
Not open for further replies.

Share This Page