How to cancel dropping items on player death

Discussion in 'Plugin Development' started by 5Shadow7Prince, Nov 19, 2011.

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


    Hi there!
    I have such code:
    entity listener, on entity death. There i can get drops, but i cant calcel this! if i need to save player's inventory i do: save his inv. on entity death (if instance Player - getDrops), and return this onPlayerRespawn. But i cant cancel dropping his inventory on player dies.
    How i can realise this?
  2. Offline


    I beleive it's


    but I can't be certain. It's early....
  3. Offline


    thanks, its working, but i have new trouble:
    i have:
    Player player = (Player) event.getEntity();, event.getDrops());
    but after that is empty! if i remove "event.getDrops().clear()" its okay, but with - fail.
  4. Offline


    you need to copy event.getDrops() to a new container before you clear it if you want to use the contents afterwards.

    It's hard to see the full problem without src but I would assume thats the problem
  5. Offline



    Even more spam here.

    Edit: Rigby90 took care of it. Thanks.
Thread Status:
Not open for further replies.

Share This Page