Update inventory changes

Discussion in 'Plugin Development' started by Baba43, Feb 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Baba43

    Hey,
    here is my code:
    Code:
    Inventory openedInventory;
    ...
    openedInventory = Bukkit.getServer().createInventory(player, 54, "Test");
    player.openInventory(openedInventory);
     
        @EventHandler
        public void onInventoryClick(InventoryClickEvent event) {
            event.getInventory().addItem(new ItemStack(Material.BONE, 10));
        }
    The problem is that the bones does not appear in the inventory until I click on the slot where they should be in.

    Any ideas how to solve hits?
     
  2. Offline

    CubixCoders

    player.updateInventory();
     
    Baba43 likes this.
  3. Offline

    Baba43

    CubixCoders Thanks.

    Do you know why its deprecated?
     
  4. Offline

    CubixCoders

    No sorry
     
  5. Offline

    DJSanderrr

    Player.gerInventory().update();

    Dont know if that works?
     
  6. Offline

    DanielSturk

  7. Offline

    MP5K

    It's deprecated because it's a workaround for a bug which shouldn't actually be used. I believe it still works though
     
Thread Status:
Not open for further replies.

Share This Page