I haven't done Java for a while and here is what I got when trying to update my plugins. Code: 2013-04-18 18:34:27 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'lotto' in plugin MCLotto v4.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:188) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.dispatchCommand(CraftServer.java:523) at net.minecraft.server.v1_5_R2.PlayerConnection.handleCommand(PlayerConnection.java:966) at net.minecraft.server.v1_5_R2.PlayerConnection.chat(PlayerConnection.java:884) at net.minecraft.server.v1_5_R2.PlayerConnection.a(PlayerConnection.java:841) at net.minecraft.server.v1_5_R2.Packet3Chat.handle(Packet3Chat.java:44) at net.minecraft.server.v1_5_R2.NetworkManager.b(NetworkManager.java:292) at net.minecraft.server.v1_5_R2.PlayerConnection.d(PlayerConnection.java:110) at net.minecraft.server.v1_5_R2.ServerConnection.b(SourceFile:35) at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:30) at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:578) at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:225) at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:474) at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:407) at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.NullPointerException at me.pineabe.modernmc.Commands.onCommand(Commands.java:126) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ... 15 more Heres a link to my CommandExecutor class. http://pastebin.com/XMCran1S
EconomyResponse r = econ.withdrawPlayer(p.getName(), plugin.getConfig().getInt("TicketFare")); Something on that line is null, my guess is plugin.getConfig().getInt("TicketFare")). Also, you don't have to have EconomyResponce for vault.
I wouldn't think getting the int from the config is resulting that, more likely that you don't set the econ variable. Since it's a public variable, I don't know if you set it somewhere else (in the main class for example), but as far as I can see, you don't set it to something at all.
Unless this changed very recently, config.getInt does not return null if the path doesn't exist (despite the JavaDocs saying it does).
I've removed the economy response as a test. All the commands work perfectly fine except for /lotto buyticket. The command will work if you have the wrong ticket number or you have already purchased a ticket previously. It's become obvious this is a vault problem (i.e anything with Economy or EconomyResponse). I will try fix it or wait for an update. If not I will switch to Register or something. Thanks for your help.
Thanks for your help That was it I had econ set to null and the setupEconomy was in the main class all I needed to do was add this code to my onCommand boolean. Code: RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class); econ = rsp.getProvider();