Vault

Vault

7M Downloads

getBalance

Dakado opened this issue · 1 comments

commented

Hi, I am trying to get players actual balance from vault but id does not work. I used the example on github (link from dev bukkit plugin page).

I used this function:
else if(cmd.getLabel().equals("huher")) {
Player player = (Player) sender;
sender.sendMessage(String.format("You have %s", econ.format(econ.getBalance(player.getName()))));
return true;
}

If I execute the command it gives me tons of errors.

06-16 10:27:47 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'huher' in plugin DakadoTest v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523)
at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:971)
at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:889)
at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:846)
at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)
at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)
at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
Caused by: java.lang.NullPointerException
at vip.production.dakado.scoreboard.Class.onCommand(Class.java:112)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
... 15 more

Any solution ?

commented

On 16/06/13 10:36, Dakado wrote:

Hi, I am trying to get players actual balance from vault but id does not
work. I used the example on github (link from dev bukkit plugin page).

I used this function:
else if(cmd.getLabel().equals("huher")) {
Player player = (Player) sender;
sender.sendMessage(String.format("You have %s",
econ.format(econ.getBalance(player.getName()))));
return true;

}

If I execute the command it gives me tons of errors.

06-16 10:27:47 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing
command 'huher' in plugin DakadoTest v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
at
org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523)
at
net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:971)
at
net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:889)
at
net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:846)
at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)
at
net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)
at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
at
net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
Caused by: java.lang.NullPointerException
at vip.production.dakado.scoreboard.Class.onCommand(Class.java:112)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
... 15 more

Any solution ?


Reply to this email directly or view it on GitHub
#424.

There is a NullPointerException, maybe because "econ" is null.

Schau doch mal vorbei
criztovyl.wordpress.com https://criztovyl.wordpress.com
joinout.de/forum https://joinout.de/forum