I am trying to make a map where only skeletons and non-hostile mobs are able to spawn. Is there a command that can do this? I don't want a redstone clock because that will lag my game and spam the chat. I am using 1.10.2.

  • Not sure about the mob spawning, but I do know that you can disable chat output with /gamerule doCommandBlockOutput false and make the command block activate without a clock using a Repeating Command Block. Commented Jul 18, 2016 at 1:47
  • 4
    @EnragedTanker The correct gamerule is just commandBlockOutput.
    – Skylinerw
    Commented Jul 18, 2016 at 1:58
  • "that will lag my game" - I'm almost sure you have not tried that. I don't think it would lag because of a single command block. Commented Jul 18, 2016 at 19:50
  • @HolyBlackCat They may have been referring to the Redstone clock Commented Jul 19, 2016 at 2:50
  • @EnragedTanker A single redstone clock is not a laggy thing too. Commented Jul 19, 2016 at 10:34

2 Answers 2


Try This

Enter this command in chat:

/scoreboard objectives add noKill dummy

Then run these commands on a repeating command block or clock:

/scoreboard players set @e noKill 1
/scoreboard players set @e[type=Player] noKill 0
/scoreboard players set @e[type=Skeleton] noKill 0

Keep adding entities that you don't want to be killed

Then this command will kill all entities that don't have a noKill score of 0:

/kill @e[score_noKill_min=1]

Hope that helps you. :)


In a repeating, always active command block type:

/kill @e[type=!Player,!Skeleton,!Item]

This will kill any entity that is not a player,skeleton or an item if you need to keep other entity's e.g. an ArmorStand add another comma and write the name of the entity you want to preserve so in this case you would add ,[type=!ArmorStand]

Hope this helps.

You must log in to answer this question.

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