


From there, you can select the set of all mobs excluding any exceptions you want with simplest and most flexible way to keep slimes from bothering you though is to turn off mob spawning altogether. It uses a scoreboard to set a score for all entities to 1, and simultaneously sets the score of all exceptions to 0. You can set up individual command blocks to kill each type of mob, which might be a small set of command blocks if your main problem is slimes.Īlternatively, you can use the methods described in this answer to select exceptions. If you're really committed to the idea of doing this with /kill, however, you can do this one of two ways. Using Commands in Minecraft: /kill and an Introduction to Position Selectors 1.11.2. Mobs will spawn only when you want them to.

No mobs will spawn, which will allow you to have a quiet creative world, free from cows, pigs, sheep, chickens, slimes, etc, while also allowing yourself to do science on mobs at will. If you don't want any mobs bothering you in your creative world, just turn off spawns with /gamerule doMobSpawning false. The simplest way to handle this is with a gamerule.
