[REQ] Disable Items drop on death

Discussion in 'Archived: Plugin Requests' started by vasil7112, Jun 5, 2012.

  1. Offline

    vasil7112

    I'd like a plugin that disables all the items drop on death.
    For the first version don't add world support(So it can be quick!)
    For the other versions you can add.
    I need that as soon as possible.
    If you can today it would be perfect!
    Add me on skype: vasil7112
     
  2. Offline

    cdncampbell

    just clear the list from the death event:

    Code:
     evt.getDrops().clear; 
     
  3. Offline

    vasil7112

    evt you mean event?
    And thanks!
     
  4. Offline

    cdncampbell

    Correct, it is the org.bukkit.event.entity.PlayerDeathEvent specifically.
     
  5. Offline

    recon88

  6. Offline

    vasil7112

    Thanks

    Also if i want on player death to drop an item or item id how do i do that? i mean whats the source code?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  7. Offline

    cdncampbell

    You could try something like:

    Code:
         
    List <ItemStack> l = evt.getDrops();
            Iterator<ItemStack> i = l.iterator();
            while(i.hasNext()){
                ItemStack item = i.next();
                if(item.getTypeId() != <KEEPITEMID>){
                    l.remove(item);
                }
             }
     
  8. Offline

    vasil7112

    I mean when they die..They lose all of their items, and when they respawn they have no items. Also there are no drops so the items get automaticly deleted..But each time you kill someone, he drops an item with a quantity..Even if he don't have it.
     
  9. Offline

    cdncampbell

    OH! Like a PVP Drop...

    I'd imagine the logic would be something like a random Material type (without the ones that are silly, like air, grass), then a random stack size (you can add weighting if you want to make it more for materials and less for equipment, etc).

    I am currently at work, but this sounds like something fun to work on at home :D
     
  10. Offline

    vasil7112

    Yes..If you wanna help me for some small things please contact me at skype.
    My username is vasil7112 there :)
    Thanks!

    But you still didn't gave me a code to do that;)

    Please when you get online or someone else, Can you give me the code on player death to drop a specific item?
    Thanks!

    Someone? Pleaseeee

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  11. Offline

    devil614

    I tried this on craftbukkit 1.2.5 R3.0 and it doesn't work, even with the permission. My items still drop.
     
  12. Offline

    vasil7112

    I made my own mini plugin with that.
    I can send you a customized one if you want. Just add me on skype, vasil7112
     
  13. Offline

    devil614

  14. Offline

    Orcem12

    @vasil7112
    See little puzzle piece in sig. Then look for drop stopper. Done.
     

Share This Page