InternalServerError-Need help please

Discussion in 'Plugin Development' started by wulfbear_joe, Aug 20, 2011.

Thread Status:
Not open for further replies.
  1. Hey there!
    Atm I am developing a little bukkitplugin called pvpoutfitter. It's in a very early phase so I just "code" the basics.
    One of this is the changing of a players armor. Therefore, I used "player.getInventory().setHelmet(new ItemStack(298, 1));". THIS works, no problem. But then, I want my players to be able to delete the armor. I tried to replace the 298 in the line above with a 0 for air. Whenever I execute the related command, it gives a Internal Server Error and I get kicked. When I relog, the armor disappeared, so the command might just worked? What can I do to solve the Server Error?
    my description is detailled enough. If not, just tell me what you need!

  2. Offline


    (No idea if this will work)
    Have you tried setHelmet(null)?
  3. Hey,
    tried it. That's what I get next:
    2011-08-21 09:56:33 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'itsover' in plugin Bukkittest v0.1
        at org.bukkit.command.PluginCommand.execute(
        at org.bukkit.command.SimpleCommandMap.dispatch(
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
        at net.minecraft.server.NetServerHandler.handleCommand(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet3Chat.a(
        at net.minecraft.server.NetworkManager.b(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.NullPointerException
        at org.bukkit.inventory.ItemStack.<init>(
        at org.bukkit.inventory.ItemStack.<init>(
        at me.wulfbear_joe.bukkittest.Bukkittest.onCommand(
        at org.bukkit.command.PluginCommand.execute(
        ... 12 more
  4. Offline


    never tried it but you could try using new ItemStack(298, 0) to delete it (e.g. setting the count of items just to 0 ^^)
  5. Offline


    Or you set the durability of the item to 0 so the game cleans it up automatically. (broken)
  6. @bassfader: I am sorry, but it didn't work.
    @bergerkiller: Which ItemStack event should I use for that?
Thread Status:
Not open for further replies.

Share This Page