Solved Problem with PlayerDeathEvent and getDrops()

Discussion in 'Plugin Development' started by Pr07o7yp3, May 16, 2013.

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

    Pr07o7yp3

    Ok, I try to remove certain items after player death and leave certain items.

    So, I try with:
    Code:
    @EventHandler
    public void onPlayerDeathEvent(PlayerDeathEvent event)
    {
        for (ItemStack drop : event.getDrops())
        {
                if (cond)
                {
                    event.getDrops().remove(drop);
                }
        }
    }
    I get this error:

    If I just use event.getDrops().clear() it works but like I said, I want to leave some items.

    I found solution for my problem. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  2. Offline

    PixelatedTNT

    What was your solution?
     
    KingFaris11 likes this.
Thread Status:
Not open for further replies.

Share This Page