Solved Plugin onEnable() ERROR in CONSOLE [URGENT]

Discussion in 'Plugin Development' started by xxPatterson, Jun 8, 2014.

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

    xxPatterson

    This is the error :
    Code:java
    1. [03:34:51 ERROR]: Error occurred while enabling zWarGrounds v1.0 (Is it up to da
    2. te?)
    3. at me.patterson.zwargrounds.zWarGrounds.onEnable(zWarGrounds.java:40) ~[
    4. ?:?]
    5. at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[c
    6. raftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    7. at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    8. .java:324) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    9. at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    10. r.java:404) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    11. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.jav
    12. a:446) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    13. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.
    14. java:380) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    15. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.reload(CraftServer.java:79
    16. 9) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    17. at org.bukkit.Bukkit.reload(Bukkit.java:288) [craftbukkit.jar:git-Bukkit
    18. -1.7.9-R0.1-b3084jnks]
    19. at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    20. 23) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    21. at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    22. 0) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    23. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServe
    24. r.java:701) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    25. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(Craf
    26. tServer.java:688) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    27. at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:
    28. 296) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    29. at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    30. 61) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    31. at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    32. 58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    33. at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    34. :469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    35. at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    36. 28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]

    This is the main class:
    Code:java
    1. package me.patterson.zwargrounds;
    2.  
    3. import me.patterson.zwargrounds.Commands.DiamondKit;
    4. import me.patterson.zwargrounds.Commands.EmeraldKit;
    5. import me.patterson.zwargrounds.Commands.IronKit;
    6. import me.patterson.zwargrounds.Commands.StarterKit;
    7. import me.patterson.zwargrounds.Commands.points;
    8. import me.patterson.zwargrounds.Commands.setspawn;
    9. import me.patterson.zwargrounds.Commands.spawn;
    10. import me.patterson.zwargrounds.events.RecyclingBin.RecyclingBin;
    11. import me.patterson.zwargrounds.events.bank.Bank;
    12. import me.patterson.zwargrounds.events.player.EntityDamageByEntity;
    13. import me.patterson.zwargrounds.events.player.PlayerChat;
    14. import me.patterson.zwargrounds.events.player.PlayerDeath;
    15. import me.patterson.zwargrounds.events.player.PlayerJoin;
    16. import me.patterson.zwargrounds.events.player.PlayerLeave;
    17. import me.patterson.zwargrounds.events.player.PlayerRespawn;
    18. import me.patterson.zwargrounds.events.sign.clickSign;
    19. import me.patterson.zwargrounds.events.sign.signChange;
    20.  
    21. import org.bukkit.Bukkit;
    22. import org.bukkit.event.Listener;
    23. import org.bukkit.plugin.java.JavaPlugin;
    24.  
    25.  
    26. public class zWarGrounds extends JavaPlugin implements Listener{
    27.  
    28.  
    29. private static zWarGrounds plugin;
    30.  
    31. public void onEnable() {
    32. plugin = this;
    33. registerEvents(this, new EntityDamageByEntity(this), new PlayerChat(this), new PlayerDeath(this), new PlayerJoin(this), new PlayerLeave(this), new PlayerRespawn(this), new Bank(this), new RecyclingBin(this), new clickSign(this), new signChange(this));
    34. getCommand("diamond").setExecutor(new DiamondKit());
    35. getCommand("iron").setExecutor(new IronKit());
    36. getCommand("emerald").setExecutor(new EmeraldKit());
    37. getCommand("points").setExecutor(new points(this));
    38. getCommand("setspawne").setExecutor(new setspawn(this));
    39. getCommand("spawn").setExecutor(new spawn(this));
    40. getCommand("kit").setExecutor(new StarterKit());
    41. }
    42.  
    43. public void onDisable() {
    44. plugin = null;
    45.  
    46.  
    47. }
    48.  
    49. public static void registerEvents(org.bukkit.plugin.Plugin plugin, Listener... listeners) {
    50. for (Listener listener : listeners) {
    51. Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
    52. }
    53. }
    54.  
    55.  
    56. public static zWarGrounds getPlugin() {
    57. return plugin;
    58. }
    59. }
    60.  

    Any idea where I went wrong with it?
     
  2. Offline

    teej107

    xxPatterson You are getting a NullPointerException at line 40. This line here?
    Code:java
    1. getCommand("kit").setExecutor(new StarterKit());
    Do you have a command called "kit"?
     
  3. Offline

    xxPatterson

    Yes
     
  4. Offline

    RawCode

    post plugin.yml
     
  5. Offline

    ZodiacTheories

    xxPatterson

    plugin.yml and StarterKit class please :)
     
  6. Offline

    AmShaegar

    There is most likely a syntax error in plugin.yml, the wrong plugin.yml included in the plugin jar or the kit command is just missing.
     
  7. Offline

    AdamQpzm

    xxPatterson I personally wouldn't really classify this as urgent. :)

    AmShaegar Syntax error would more likely to result in an invalid plugin description file ;)
     
  8. Offline

    ZodiacTheories

    AdamQpzm

    Maybe it is urgent, maybe bullies at school forced him to do this by a certain date :p
     
  9. Offline

    AmShaegar

    AdamQpzm Or its just assigned a wrong node an thus ignored.
     
    AdamQpzm likes this.
  10. Offline

    xxPatterson

    Yup, found the error in plugin.yml, forgot to register the kit command :p
     
Thread Status:
Not open for further replies.

Share This Page