I have been trying to make a minecraft map in windows 10 edition but I can't get the setbock command to work if all of the mobs in the area have been killed.

  • 2
    What do you mean all the mobs in an "area"? Could you test and see if there are no zombies in a radius from a block and then run commands, or do you have to test something else? – SpiceWeasel Jan 6 at 20:42

A solution I found is that you can do a command testfor this will test for entities:

/testfor @e[type=zombie]

This will test for all currently loaded zombies

 /testfor @e[type=zombie,(r for PE, distance for PC)=20]

This will test for all zombies within a 20 block radius. Radius is building that many blocks off the sides and connecting them to a cube. Thus displaying radius. Than have a comparator coming out of the command block and redstone repeater followed by a solid block with a redstone torch

  • As the question states, the post is for bedrock edition. Specifying that the selector r should be substituted with distance for java edition is not required, since /testfor has been replaced with /execute in the Java edition. – Jayden Jan 9 at 1:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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