Error on loading Plugin [SOLVED]

Discussion in 'Plugin Development' started by recon88, Feb 19, 2012.

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

    recon88

    Can't figure out what I'm doing wrong...

    HTML:
    2012-02-20 04:28:43 [INFO] [gott] Loading  gottMode v1.0!
    2012-02-20 04:28:43 [INFO] [gott] Commands available and loaded!
    2012-02-20 04:28:43 [SEVERE] Error occurred while enabling gottMode v1.0 (Is it up to date?): null
    java.lang.NullPointerException
    at com.recon.gott.gottMode.gottMode.onEnable(gottPowers.java:135)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:231)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:379)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:191)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:174)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:344)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    
    HTML:
    public void onEnable() {
         
                String message = "[gott] Commands available and loaded!";
                String error = "[gott] another plugin is using the command already ";
                try{
                    getCommand("gott").setExecutor(new gottCommand(this));
                    System.out.println(message + "gott.");
                    list.put("gott", "<Name> - toggles it on/off.");
                } catch(Exception e) {
                    System.out.println(error + "gott.");
                }
                getCommand("gotton").setExecutor(new gottCommand(this));
                getCommand("gottoff").setExecutor(new gottCommand(this));
                try{
                    getCommand("gottpow").setExecutor(new commands(this));
                    System.out.println(message + " gottMode.");
                    list.put(" gottMode", "- This message.");
                } catch(Exception e) {
                    System.out.println(error + " gottMode. outch");
                }
                loadSettings();
                PluginManager pm = getServer().getPluginManager();
                pm.registerEvents(new  gottModeEntityListener(this), this);
                pm.registerEvents(new  gottModePlayerListener(this), this);
                PluginDescriptionFile pdfFile = this.getDescription();
                System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " activated" );
                setupPermissions();
                populateLists();
            }
     
  2. Offline

    Gravity

    We need to know what is at gottPowers.java on line 135.
    Please refer to THIS thread to learn how to read your own stack-traces
     
  3. Offline

    recon88

    Line 135 is a part of what i already posted...

    HTML:
    Line 135: getCommand("gotton").setExecutor(new gottCommand(this));
    Line 136: getCommand("gottoff").setExecutor(new gottCommand(this));
    Edit:
    Solved... Forgot to add the commands in plugin.yml -.-
    My fault
     
  4. Offline

    bassfader

    Sounds like getCommand("gotton") returns null... Have you put the "gotton" and "gottoff" commands in you plugin.yml file?
     
  5. Offline

    recon88

    Yea I already got it but thanks =)
    That was the problem. Was totally tired last night so i forgot it
     
Thread Status:
Not open for further replies.

Share This Page