Filled "NoDrop"Code

Discussion in 'Archived: Plugin Requests' started by tovd1234, Sep 7, 2014.

  1. Offline


    Hello everyone, I've made a KitPvP plugin, the only problem is that people can just drop all their stuff. I want to get some code that you can only drop soups/empty stews. And also on death, I only want soups (The filled ones) to be dropped. I don't want a plugin, but just some code so I can put it in my KitPvP plugin :)

    Thanks, Tim/tovd1234
  2. Offline

    mrCookieSlime Retired Staff

    Wrong section... This section is for Requests not Developement...

    And after a bit searching on Google, you would have found what you're looking for. Those are pretty easy Things and you will find a solution for sure.

    But I should help you a little bit at least:

    1. @EventHandler
    2. public void onLeave(PlayerDropItemEvent e) {
    3. if (e.getItemDrop().getItemStack().getType() != Material.MUSHROOM_SOUP) e.setCancelled(true);
    4. }

    And with the drops on Death:

Share This Page