TransWikia.com

What is the command to kill all mobs?

Arqade Asked by TheRedBlocker on March 14, 2021

I’m building a mini-game on a flat world and slimes are spawning on it. They keep setting off TNT and other traps, forcing me to rebuild every time.

What is a command that I can use to kill all mobs?

8 Answers

Set the difficulty to peaceful in the options menu

Answered by Mano on March 14, 2021

Type and enter /gamerule doMobSpawning false

Answered by MCCCS on March 14, 2021

If you're willing to start a new superflat world, you can create custom superflat terrain that doesn't consist of 4 layers. The reason why slimes spawn so often in superflat worlds is because you're actually really close to the void.

If you generate a new superflat world that starts at Y level 64, you won't have any slimes spawn.

Answered by Gigazelle on March 14, 2021

Put this in a command block:

/kill @e [type = Slime]

Answered by Frank Soll on March 14, 2021

Put this in a command block ( /kill @e[type=Slime] ), put the command block on repeat, and then place a redstone block next to it.

Answered by Aidan on March 14, 2021

There are a variety of ways to stop slimes from spawning in your area:

Answered by Mark Giraffe on March 14, 2021

If you want to kill every single entity, then do this:

/kill @e

Just slimes? Do this:

/kill @e[type=minecraft:slime]

Don't want the death animation or for them to split? Do this:

/execute at @e[type=minecraft:slime] run tp @e[type=minecraft:slime] ~ -1000 ~

I can't take credit for that last tp command, credit for that goes to ExpertCoder14

Answered by Penguin on March 14, 2021

Do /kill @e to kill all entity including dropped items, started TNTs, arrows, yourself and minecarts.

Do /kill @e[type=minecraft:slime] to kill all slimes.

Do /kill @e[type=!minecraft:player] (not !=) to kill everything that is not a player. Note that this removes started TNTs, arrows, minecarts and dropped items too.

EDIT:

  1. If you only want to kill every living creature except player, do /gamemode peaceful or /gamerule doMobSpawning false as suggested in other answers.
  2. Also suggested by others, if you do not want the slimes to split after killing them or other mobs leaving lots of dropped items on the ground, use /execute at x run tp x ~ -1000 ~ where x is one of @e, @e[type!=minecraft:player] or @e[type=minecraft:slime] or other choices you may choose.
  3. Do kill @e[distance=..r] to kill everything within the radius of r. This can be helpful if you are only playing games in a certain area.

NOTE:

  • These commands are tested in 1.16.4, Java Edition. BUT NOT ANY ELSE VERSIONS.

Answered by Chrimpyslime on March 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP