Bukkit coding

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

  1. Offline

    Ahobo30

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    This post has been edited 2 times. It was last edited by Ahobo30 Mar 8, 2013.
  2. Offline

    c0mp 13371331337 Moderator

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Moved to Plugin Development!
  3. Offline

    mastermustard

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    well for one remove your eventhandeler from your onEnable().

    2nd watch this video:
  4. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    If the tutorial tells you to get the Logger "Minecraft" it is bad and you should not follow that tutorial.

    This post has been edited 1 time. It was last edited by Sagacious_Zed Mar 8, 2013.
    drtshock and Tirelessly like this.
  5. Offline

    RealDope

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  6. Offline

    coobro123

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    you should probably start on a command.

Share This Page