I want to stop mobs from spawning in a specific area because a mob farm there is lagging my server. How do I do this? Is it possible to do this with command blocks in vanilla Minecraft?

  • Does a command block that constantly kills mobs inside work? Or do you want to prevent mob spawning entirely? – 54D Mar 6 '17 at 8:26
  • A command block which kills mobs, and entities within a certain range. – Freshii Mar 6 '17 at 8:45
  • Which Minecraft version? – 54D Mar 6 '17 at 8:47
  • kill @e[type=!Player,r=<range>] What do I define in the range? Do I put in co-ordinates? or just a number which will define the radius? – Freshii Mar 6 '17 at 8:59
  • A number. Unit is blocks. – 54D Mar 6 '17 at 9:02

Put an Always Active and Repeat Command Block with the following command:

kill @e[type=!Player,r=<range>]

Where <range> is the radius of the area that will have all entities except Players killed constantly.


Changing the biome to Mushroom Island or Mushroom Island Shore will stop hostile mobs from spawning. This can be done with McEdit. Killing the mobs via command blocks will cause even more lag from the drops. While this is not vanilla, you mentioned you are on a server, (assuming its bukkit) there are plugins that let you define regions and then disable spawning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.