48

So, my friend just implemented a bunch of new mods into his SMP server, which meant a host of new commands to play with.

I thought I'd give the /mobspawn command a few goes, and see what I could achieve. So I headed off to the server's jail (I forget why this particular location compelled me), and gave it a few spins.


I seem to have made a bit of an error in judgement.


About 60 assorted pigs, cows, and chickens crammed into a small enclosed space

What can I do to get rid of this mess? Is there a command or some other technique I can use to clear out any mobs in my immediate vicinity?

3
  • 14
    Is fire an option? Commented May 4, 2011 at 5:24
  • @Blueraja > Unfortunately, since this is in the server jail, I can't build/place anything in the area.
    – GnomeSlice
    Commented May 4, 2011 at 5:26
  • 8
    Part of me knows it's probably a bad idea, but the fact that this question is tagged with [murder] amuses me to no end.
    – lilserf
    Commented May 4, 2011 at 14:15

8 Answers 8

19

Depending on the mods installed, /butcher [radius] should work. Of course, you'd need access to the commands to do so.

7
  • 1
    Is this command one of the defaults?
    – GnomeSlice
    Commented May 4, 2011 at 20:23
  • 8
    @Gnome it's part of WorldEdit's Utilities
    – Zommuter
    Commented May 4, 2011 at 20:26
  • 1
    @TobiasKienzler: That is also part of Bukkit Essentials, which also happens to be the same server mod that provides /spawnmob, conveniently. Of course, /butcher is just an alias of /killall if you only have Essentials installed. (Otherwise, I believe WorldEdit's butcher may overwrite Essentials's, but I'm not 100% sure. Still gets the job done though.)
    – Reid
    Commented Jan 29, 2012 at 7:25
  • That mod is trash. Dont use mods. just use /kill
    – Asadefa
    Commented Feb 10, 2019 at 22:29
  • @Asadefa You do realize that this answer was posted before /kill was added to vanilla minecraft.
    – pppery
    Commented Jul 11, 2019 at 17:03
18

This is now possible in vanilla with a feature introduced in the 1.8 snapshots. You can now /kill animals and mobs using the @e selector. For instance to kill all the pigs in that pen, you would use

/kill @e[type=Pig,distance=..10]

And similarly, you'd use Cow instead of Pig to kill all the cows in the pen. I use the radius specifier so that you don't kill all the pigs or cows that are currently loaded in your world, just the ones that are within your vicinity (10m). Note that there's only one space, between /kill and @e, in this command. Adding additional spaces will cause the command to not parse properly, and will not only kill you, but possibly every other entity that's loaded in the world.

6

No-mod solution:

Place some water, and TNT in the water (make sure you aren't replacing the water), and light it. TNT in water will do no damage to blocks (leaving your jail intact), but full damage to entities (the unwanted animals). Do not place more than two TNT at a time, as explosions might blast other activated TNT out of the water, allowing it to do damage to blocks.

Note that the TNT will also damage any minecarts, boats, or loose resources in the area, whether or not there is a clear line-of-sight to them.

3
  • 5
    OP mentioned he wasn't able to place anything in the room. Commented May 4, 2011 at 22:14
  • 4
    @Raven > Yes, but that particular restriction is pretty localized.
    – GnomeSlice
    Commented May 4, 2011 at 23:51
  • Oops, I didn't read all the comments. Hopefully this is useful elsewhere.
    – Kevin Reid
    Commented May 5, 2011 at 13:17
6

Get some stone swords and button mash!

3

If you are in creative, turn into survival, then use a sword and just kill them, if this takes too long, well, I have no idea, I am having the same problem on my server right now too, somebody spawned thousands of chickens and i cant kill them all because of the lag.

3

@MBraedley's answer is good if you don't have any mods. However, as of 1.12.2 the no-mod vanilla syntax is slightly different:

/kill @e[type=pig,r=20]

Where r is the radius. "distance" was not a valid option for me.

If you do happen to have a mod with the /butcher command, here are additional options you can pass:

  • /butcher : Kills all hostile mobs
  • /butcher -p : also kills pets
  • /butcher -n : also kills NPCs
  • /butcher -g : also kills Golems
  • /butcher -a : also kills animals
  • /butcher -f : compounds all previous flags
  • /butcher -l : strikes lightning on each killed mob

So you could kill a bunch of pigs in a radius of 20 with /butcher -a 20

1
  • I like your answer better
    – Asadefa
    Commented Feb 10, 2019 at 22:29
2

This may not have been an option at the time the question was asked, but one as-yet unmentioned method to try is to throw a bunch of Splash Potion of Harming (II). Do note that if this same situation were to occur with undead mobs like zombies or skeletons, Splash Potion of Healing should be used instead.

This method tends to work best if you are in creative mode, as the splash potion will not be removed from your inventory when used, allowing you to easily rapid-fire carpet-bomb the infested area. It can be considerably quicker than manually swording every single mob in the area, doesn't rely on commands that may not be available to you, and works handily in protected areas where you cannot place blocks.

-1

For pigs, make a pit of lava around you then hold a carrot/carrot on a stick - they will come to you and burn.

2
  • 2
    The OP mentioned that they cannot build in the server jail.
    – user28379
    Commented Nov 3, 2012 at 0:12
  • 1
    That restriction is pretty localized.
    – Timtech
    Commented Nov 2, 2013 at 23:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .