Minecraft – How to make slimes not spawn randomly

minecraft-commandsminecraft-java-edition

How do you make slimes not spawn? They are very annoying especially in a superflat world. I want to make them not spawn randomly.
In 1.16

Best Answer

I see two simple ways of doing this:

  • Use /gamerule doMobSpawning false to disable spawning of all mobs in your superflat world.
  • Use a repeating command block to /tp @e[type=minecraft:slime] ~ -1000 ~, so that they don't split into multiple slimes.
  • Set the difficulty to peaceful.