InventoryClickEvent bug

Discussion in 'Plugin Development' started by TheMinecraftKnight, Apr 29, 2017.

Thread Status:
Not open for further replies.
  1. Hi, I'm trying to get an item from a config file using this code
    Code:
    String path = "chests." + chestName + "." + tier;
                    ItemStack item = new ItemStack(Material.getMaterial(config.getString(path + ".Item")),
                            config.getInt(path + ".Amount"), (short) config.getInt(path + ".Data"));
    However, upon clicking on an item in the inventory, nothing happens and I get an error in console (that does not include my code in the stack trace at all).

    Here it is:
    Code:
    [16:57:40] [Server thread/ERROR]: Could not pass event InventoryClickEvent to NexusChests v1.0
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1630) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:31) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:9) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
        at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
    Caused by: java.lang.NullPointerException
    Any ideas why this isn't working?
     
  2. Offline

    Zombie_Striker

    @TheMinecraftKnight
    1. Why are you still on 1.8? Please read this.
    2. Is the config null?
    3. Are the string/ints at those paths null?
    4. Can bukkit find the material equal to the string?
     
Thread Status:
Not open for further replies.

Share This Page