Pick up entity event / dectect if item is removed (picked up or destroyed)

Discussion in 'Plugin Development' started by CaiusTSM, Jul 16, 2011.

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

    CaiusTSM

    Is there any event(or other way) I can detect when a player picks up a item/the item is removed(destroyed or put into Something's inventory).
     
  2. Offline

    CSharpRU

    Code:
    public void onPlayerPickupItem(PlayerPickupItemEvent event)
    {
        /* Your code. And here you can check if item pickup by another player. */
    }
    
    public void onEntityDeath(EntityDeathEvent event)
    {
        Entity ent = event.getEntity();
    
        // Not sure.
        if(ent instanceof Item)
            /* Your code. */
    }
    
     
  3. Offline

    CaiusTSM

    Thank you!
     
Thread Status:
Not open for further replies.

Share This Page