Simple plugin error

Discussion in 'Plugin Development' started by herghost, May 10, 2012.

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

    herghost

    Hi Guys

    I started a plugin around 5 months ago and since then have forgotten everything I learnt! Ive started a new one and have run into a puzzling problem right from the off

    Basically all I am trying to do is display a plugin enabled message in the log when the plugin starts!

    Here are my files

    Code:
    package com.tekkitmaster.nethercontrol;
     
    import java.util.logging.Logger;
    import org.bukkit.plugin.java.JavaPlugin;
     
     
    public class NetherControl extends JavaPlugin
    {
        Logger log;
     
        public void onEnable()
       
        {
                log = this.getLogger();
                log.info("NetherControl Enabled");
        }
           
        public void onDisable()
        {
            log.info("NetherControl Disabled");
        }
           
           
    }
    
    and my plugin.yml

    Code:
    name: nethercontrol
    main: com.tekkitmaster.nethercontrol.nethercontrol
    description: Control Access to the Nether
    version: 0.1

    and my error


    I dont understand what I have done to cause this?
     
  2. Code:
    public class Nethercontrol extends JavaPlugin implements Listener
    {
        public Logger log;
       
        public void onEnable()
        {
            log = getLogger();
           
            getServer().getPluginManager().registerEvents(this, this);
        }
       
        @EventHandler()
        public void onEnable()
                {
                    log.info("Enabled");
                }
        public void onEnable()
                {
                    log.info("Disabled");
                }
    }
    or something like that
     
  3. Offline

    mmiillkkaa

    Your main class in plugin.yml should be com.tekkitmaster.nethercontrol.NetherControl
     
    McLuke500 likes this.
  4. Offline

    Father Of Time

    FYI: You shouldn't place "enabled" and "disabled" statements within your onEnable/onDisable functions anymore, Bukkit 1.0.0 and above automatically populate this information from the config.yml and display it in the log during compile.
     
  5. Offline

    McLuke500

    Like mmiillkkaa said you named the class wrong in the plugin.yml
     
Thread Status:
Not open for further replies.

Share This Page