Remove from inventory updating

Discussion in 'Plugin Development' started by flyslasher, Feb 23, 2011.

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

    flyslasher

    Update players inventory?

    Code:
    int index = pInv.first( id );
    ItemStack item = pInv.getItem( index );
    int amount = item.getAmount();
    item.setAmount( amount - 1 );
    pInv.setItem( index, item );
    It works except that the player does not see the change unless they relog.
    How can I update a players inventory? The only other way was player.updateInventory() but thats deprecated! Any ideas?
    --- merged: Feb 24, 2011 5:33 AM ---
    NVM, figured it out. Looked for a bit and came across this
    Code:
    ((CraftPlayer)thePlayer).getHandle().activeContainer.a()
     
  2. Offline

    Edward Hand

    You're welcome [​IMG]
     
Thread Status:
Not open for further replies.

Share This Page