diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java index a77b0b863..ef9d3c6af 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java @@ -158,21 +158,36 @@ public class Commandremove extends EssentialsCommand for (ToRemove toRemove : removeTypes) { - if (e instanceof Tameable && ((Tameable)e).isTamed()) + // We should skip any TAMED animals unless we are specifially targetting them. + if (e instanceof Tameable && ((Tameable)e).isTamed() + && !removeTypes.contains(ToRemove.TAMED)) { - if (toRemove == ToRemove.TAMED) - { - e.remove(); - removed++; - } - else - { - continue; - } + continue; + } + + // We should skip any NAMED animals unless we are specifially targetting them. + if (e instanceof LivingEntity && ((LivingEntity)e).getCustomName() != null + && !removeTypes.contains(ToRemove.NAMED)) + { + continue; } switch (toRemove) { + case TAMED: + if (e instanceof Tameable && ((Tameable)e).isTamed()) + { + e.remove(); + removed++; + } + break; + case NAMED: + if (e instanceof LivingEntity && ((LivingEntity)e).getCustomName() != null) + { + e.remove(); + removed++; + } + break; case DROPS: if (e instanceof Item) { @@ -305,6 +320,7 @@ public class Commandremove extends EssentialsCommand ENTITIES, ALL, CUSTOM, - TAMED + TAMED, + NAMED } } \ No newline at end of file diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index af056c15a..23d0bd17a 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -304,7 +304,7 @@ commands: aliases: [formula,eformula,method,emethod,erecipe,recipes,erecipes] remove: description: Removes entities in your world. - usage: / [radius|world] + usage: / [radius|world] aliases: [eremove,butcher,ebutcher,killall,ekillall,mobkill,emobkill] repair: description: Repairs the durability of one or all items.