Checker if it enters into the inventory.

Discussion in 'Plugin Development' started by sharkale, Mar 15, 2011.

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

    sharkale

    Hi. i'm new.

    Is there any method to check if an item enters into the inventory?

    like...

    in player.getInventory()

    fitInto(int itemID, int amount) : boolean

    --------------------

    and how drop an item in a player? like player.give(id, amount) // not intentory().addItem

    sorry i dont found.

    Any help is appreciated.
     
  2. Offline

    CypherX

    There's a PLAYER_PICKUP_ITEM event you can listen for. To give a player an item you would call getInventory().addItem(ItemStack item) on a Player object.
     
  3. Offline

    sharkale

    i say "not intentory().addItem" but thanks. i need the give method, not insert the item in the inventory.
     
  4. Offline

    CypherX

    That's the only way I know of to "give" a player an item. Are you looking for a way to drop an item out in front of them? Please clarify.
     
  5. Offline

    Joey Clover

    I thinks he wants it to be added to the inventory and then immediately threw out in front of them, like somebody has gave them the item.
     
Thread Status:
Not open for further replies.

Share This Page