NullPointerException when getting Content of inventory

Discussion in 'Plugin Development' started by Julian1Reinhardt, Sep 14, 2013.

Thread Status:
Not open for further replies.
  1. I have the code
    Code:
    ItemStack[] contents = plugin.inventory.getContents();
    But when I try it (run the code) it throws a NullPointerException.
     
  2. This requires some more context. Either plugin or plugin.inventory are definitly null, though :p
     
  3. PeterK
    The plugin:
    Code:
    public main plugin;
        public listener (main a)
        {
            this.plugin = a;
        }
    And the plugin.inventory (in main.class)
    Code:
    Inventory inventory = Bukkit.createInventory(p, 54, "ChestInventory");
     
Thread Status:
Not open for further replies.

Share This Page