Filled Player's Drops Disable

Discussion in 'Archived: Plugin Requests' started by Sw_aG, Jul 7, 2014.

  1. Offline

    Sw_aG

    Dear very kind Plugin makers,
    Plugin category: Admin-tools


    Suggested name: Player'sDropsDisable

    What I want: I want a plugin that can disable/enable specific player's death drops (As keepInventory but i dont want the player to keep his items, i want them to get delete if That player will die.
    Example: If i ran the command (From the console or from a player) "/pd disable <player>" then that player will die, Then his items wont be drop and he wont keep them either, they'll removed from his inventory.

    Ideas for commands:

    /pd disable <player name>
    /pd enable <player name>

    Ideas for permissions: pd.toggle


    When I'd like it by: ASAP

    Version: 1.7.2 R3

    Thanks In the future! :rolleyes:
     
  2. Offline

    RoaxZ

    I will make this! :)
     
    Sw_aG likes this.
  3. Offline

    Sw_aG

    RoaxZ It'll be great! , Thanks mate :D
     
  4. Offline

    BaHeTo0

    lets see who can make it first :)
     
  5. Offline

    JordyPwner

    BaHeTo0 i could make this only for yourself ;3 i mean you can only your enabled or disabled
     
    Sw_aG likes this.
  6. Offline

    RoaxZ

    Sorry, can't do it. Got to go now, goodluck other plugin devs.
     
    Sw_aG likes this.
  7. Offline

    BaHeTo0

    so do you want a permission node?
     
    Sw_aG likes this.
  8. Offline

    RoaxZ

    Ideas for permissions: pd.toggle

    this is what he said ._.
     
    Sw_aG likes this.
  9. Offline

    BaHeTo0

    ok almost done

    Download: <Edit by Moderator: Redacted mediafire url>

    It should work. If any buggs occur please tell me.

    NOTE: player names are case sensitive!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
    Sw_aG likes this.
  10. Offline

    timtower Administrator Administrator Moderator

    BaHeTo0 URL shortners aren't allowed
     
    Sw_aG likes this.
  11. Offline

    BaHeTo0

    sorry i did not know that. so only through mediafire right?
     
  12. Offline

    timtower Administrator Administrator Moderator

    Or any way that isn't through an url shortner or something where you make money of it
     
  13. Offline

    BaHeTo0

    why is this stupid rule? I want to get rewarded for my efforts
     
  14. Offline

    JordyPwner

    BaHeTo0 can i have the source? just to check it out?
     
  15. Offline

    Sw_aG

    BaHeTo0 The plugin is working as keepInventory work, i explained i want it to be diffrent.

    What I want: I want a plugin that can disable/enable specific player's death drops (As keepInventory but i dont want the player to keep his items, i want them to get delete if That player will die.
    Example: If i ran the command (From the console or from a player) "/pd disable <player>" then that player will die, Then his items wont be drop and he wont keep them either, they'll removed from his inventory.
     
  16. Offline

    BaHeTo0


    Code:java
    1. package me.BaHeTo0.PDD;
    2.  
    3. import java.util.ArrayList;
    4.  
    5. import org.bukkit.ChatColor;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.event.EventHandler;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.event.entity.PlayerDeathEvent;
    11. import org.bukkit.plugin.java.JavaPlugin;
    12.  
    13. public class Main extends JavaPlugin implements Listener{
    14.  
    15. ArrayList<String> cantdrop = new ArrayList<String>();
    16.  
    17. public void onEnable(){
    18. getServer().getPluginManager().registerEvents(this,this);
    19. cantdrop = (ArrayList<String>) getConfig().getStringList("cantdrop");
    20. }
    21. public void onDisable(){
    22. getConfig().set("cantdrop", cantdrop);
    23.  
    24. saveConfig();
    25. }
    26. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    27. if(commandLabel.equalsIgnoreCase("pd") && sender.hasPermission("pd.toggle"))
    28. if(args.length == 2){
    29. if(args[0].equalsIgnoreCase("enable")){
    30. cantdrop.add(args[1]);
    31. }
    32. if(args[0].equalsIgnoreCase("disable")){
    33. cantdrop.remove(args[1]);
    34. }
    35. }
    36. else{
    37. sender.sendMessage(ChatColor.RED + "Correct usage: /pd <enable/disable> <player>");
    38. sender.sendMessage(ChatColor.RED + "Player names are case sensitive!!!");
    39. }
    40.  
    41. return false;
    42. }
    43. @EventHandler
    44. public void onDeath(PlayerDeathEvent e){
    45. if(cantdrop.contains(e.getEntity().getName())){
    46. e.getDrops().clear();
    47. e.getEntity().getInventory().clear();
    48. }
    49. else return;
    50. }
    51.  
    52.  
    53. }
    54.  
     
  17. Offline

    timtower Administrator Administrator Moderator

    Bukkit has a rule about making money off this.
    And you probably want to register your listener
     
  18. Offline

    BaHeTo0


    ok fixing it
     
    Sw_aG likes this.
  19. Offline

    Sw_aG

    BaHeTo0 Kk no rush :D
    Thanks btw!
     
  20. Offline

    BaHeTo0

    Try it now: <Edit by Moderator: Redacted mediafire url>
     
    Last edited by a moderator: Nov 2, 2016
    Sw_aG likes this.
  21. Offline

    Sw_aG

    BaHeTo0 Its still droping items, i need the player who die wont drop items and wont keep them either.
     
  22. Offline

    BaHeTo0

    i know, but i dont know what exactly is wrong
     
  23. Offline

    Sw_aG

    timtower Maybe you know what's the problem?
     
  24. Offline

    timtower Administrator Administrator Moderator

    You forgot to register the event
     
    Sw_aG likes this.
  25. Offline

    BaHeTo0

    [quote uid=87695 name="timtower" post=2636736]You forgot to register the event[/quote]

    thanks gonna fix it in a bit

    Sw_aG Try it now: <Edit by Moderator: Redacted mediafire url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
    Sw_aG likes this.
  26. Offline

    Sw_aG

    [quote uid=90951205 name="BaHeTo0" post=2636745]Sw_aG Try it now: <Edit by Moderator: Redacted mediafire url>
    BaHeTo0 Still :/ Its droping items
     
    Last edited by a moderator: Nov 2, 2016
  27. Offline

    RoaxZ

    @BaHeTo0

    Are you adding the enable?
    1. if(args[1].equalsIgnoreCase("enable")){
    1. cantdrop.add(args[1]);
     
  28. Offline

    BaHeTo0

    [quote uid=90821780 name="RoaxZ" post=2636774]@BaHeTo0

    Are you adding the enable?
    3. <font color="#ffffff"><font color="#f26100"><font color="#c6c765">if</font><font color="#ffffff">(</font>args<font color="#ffffff">[</font><font color="#319994">1</font><font color="#ffffff">]</font>.<font color="#ffffff">equalsIgnoreCase</font><font color="#ffffff">(</font><font color="#52f700">"enable"</font><font color="#ffffff">)</font><font color="#ffffff">)</font><font color="#ffffff">{</font></font></font>

    4. <font color="#ffffff"><font color="#f26100">cantdrop.<font color="#ffffff">add</font><font color="#ffffff">(</font>args<font color="#ffffff">[</font><font color="#319994">1</font><font color="#ffffff">]</font><font color="#ffffff">)</font>;</font></font>

    [/quote]
    sorry may bad! these args are confising sometimes

    Sorry thats what happens when i rush xD! Try now: <Edit by Moderator: Redacted mediafire url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
    Sw_aG likes this.
  29. Offline

    RoaxZ

    [quote uid=90951205 name="BaHeTo0" post=2636797]Sorry thats what happens when i rush xD! Try now: <Edit by Moderator: Redacted mediafire url>

    No problem, not everything is perfect on first try.
     
    Last edited by a moderator: Nov 2, 2016
    Sw_aG likes this.
  30. Offline

    Sw_aG

    RoaxZ likes this.

Share This Page