Hello. I am making a plants vs zombies adventure map. If the zombies reach the house (plate), you have to do the level again. Is there a command or way to get rid of all zombies in a world so the level is replayable?
you could have a command block set up so one sets the difficulty to peaceful, then a comparator going out of it into one setting it to the regular difficulty, thus despawning the mobs. I am not entirely sure how to make it resettable
another method would be to have a ridiculous amount of instant damage/healing 127 splash potions spawn on the ground, but the other method is MUCH easier
You don't need a comparator, a repeater will work fine as long as it's being powered correctly.
So yes, as with the responses above, it's just a matter of changing the game to peaceful and back. The amount of delay between going from peaceful to normal doesn't matter, but you will need some form of delay so the command blocks go off in the correct order.
Hello. I am making a plants vs zombies adventure map. If the zombies reach the house (plate), you have to do the level again. Is there a command or way to get rid of all zombies in a world so the level is replayable?
I'm not 100% sure if this is a vanilla command, but I'm pretty sure /butcher works for killing all mobs in a map.
If that doesn't work, you can of course have a command block set the difficulty to 0 and then immediately switch it back to 1, 2, or 3.
You don't need a comparator, a repeater will work fine as long as it's being powered correctly.
So yes, as with the responses above, it's just a matter of changing the game to peaceful and back. The amount of delay between going from peaceful to normal doesn't matter, but you will need some form of delay so the command blocks go off in the correct order.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I'm not 100% sure if this is a vanilla command, but I'm pretty sure /butcher works for killing all mobs in a map.
If that doesn't work, you can of course have a command block set the difficulty to 0 and then immediately switch it back to 1, 2, or 3.