Bukkit coding

Discussion in 'Plugin Development' started by Ahobo30, Mar 7, 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:
    package com.minenamic.bukkit.SuperPick;
     
    import java.util.logging.Logger;
     
    import org.bukkit.event.Event;
    import org.bukkit.event.EventPriority;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class SuperPick extends JavaPlugin {
     
        private Logger log = Logger.getLogger("Minecraft");
        public void onEnable(){
            @EventHandler(priority = EventPriority.NORMAL) {
            this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_INTERACT, l, Event.Priority.Normal, this);
            this.logMessage("Enabled.");
        }
         
        }
     
        public void onDisable(){
            this.logMessage("Disabled.");
         
        }
     
        public void logMessage (String msg){
            PluginDescriptionFile pdFile = this.getDescription();
            this.log.info(pdFile.getName() + " " + pdFile.getVersion() + ": " + msg);
         
        }
     
    }
    
    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. Offline

    mastermustard

    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

    RealDope

  6. Offline

    coobro123

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

Share This Page