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!
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.
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.
Code:java package me.BaHeTo0.PDD; import java.util.ArrayList; import org.bukkit.ChatColor;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.entity.PlayerDeathEvent;import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin implements Listener{ ArrayList<String> cantdrop = new ArrayList<String>(); public void onEnable(){getServer().getPluginManager().registerEvents(this,this);cantdrop = (ArrayList<String>) getConfig().getStringList("cantdrop");}public void onDisable(){getConfig().set("cantdrop", cantdrop); saveConfig();}public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){if(commandLabel.equalsIgnoreCase("pd") && sender.hasPermission("pd.toggle"))if(args.length == 2){if(args[0].equalsIgnoreCase("enable")){cantdrop.add(args[1]);}if(args[0].equalsIgnoreCase("disable")){cantdrop.remove(args[1]);}}else{sender.sendMessage(ChatColor.RED + "Correct usage: /pd <enable/disable> <player>");sender.sendMessage(ChatColor.RED + "Player names are case sensitive!!!");} return false;}@EventHandlerpublic void onDeath(PlayerDeathEvent e){if(cantdrop.contains(e.getEntity().getName())){e.getDrops().clear();e.getEntity().getInventory().clear();}else return;} }
BaHeTo0 Its still droping items, i need the player who die wont drop items and wont keep them either.
[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.
[quote uid=90951205 name="BaHeTo0" post=2636745]Sw_aG Try it now: <Edit by Moderator: Redacted mediafire url> BaHeTo0 Still :/ Its droping items
[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.
[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.