So here's the deal. I want to make a dungeon adventure map where one of the trials is to defeat all the mobs in a room. The door to the next room shouldn't open until all the mobs in this room have been killed.
How should I go about doing this? Pretend I'm very new to command blocks. (Because I'm very new to command blocks.)
**Edit: Just to be clear, the main thing I don't know how to do here is test to see that all the mobs have been killed.
you need a way to get the mobs you want into your dungeon example summon command or spawners
after that
go to yt google for tutorials about testfor entities
then google for tutorials about setblock
testfor all the hostile entities in your dungeon if it reaches 0 place a redstone close to the door
else you can replace the door with a opend one i am personaly not a big fan of the ingame doors i normaly use redstone doors with sticky pistons 2x2 or use commands only to spawn and despawn strucktures
I know how to spawn mobs in with command blocks. I just don't know how to test to see if they're all dead. I've been searching for tutorials on that and I can't seem to find anything. All I find are people who want to do it but don't know how.
the testfor @e command lists and counts all the entities just make a command chain to test for type=zombie type=spider ... and if all of them result in 0 then do something
This works. I ended up using a command block with the command "/testfor @e[type=Zombie,r=30]". I hooked this up to a clock so it would constantly be checking to see if there are any zombies within a 30 block radius. If there are any zombies, the command block outputs a redstone signal. I hooked that up to a Not gate so that the signal would be false as long as there are zombies nearby.
I would imagine I could just make a bunch of these clocks checking for each type of mob, hook them all up to Not gates, and then hook them all up to And gates. Not very compact, but it should get the job done.
So here's the deal. I want to make a dungeon adventure map where one of the trials is to defeat all the mobs in a room. The door to the next room shouldn't open until all the mobs in this room have been killed.
How should I go about doing this? Pretend I'm very new to command blocks. (Because I'm very new to command blocks.)
**Edit: Just to be clear, the main thing I don't know how to do here is test to see that all the mobs have been killed.
I know how to spawn mobs in with command blocks. I just don't know how to test to see if they're all dead. I've been searching for tutorials on that and I can't seem to find anything. All I find are people who want to do it but don't know how.
This works. I ended up using a command block with the command "/testfor @e[type=Zombie,r=30]". I hooked this up to a clock so it would constantly be checking to see if there are any zombies within a 30 block radius. If there are any zombies, the command block outputs a redstone signal. I hooked that up to a Not gate so that the signal would be false as long as there are zombies nearby.
I would imagine I could just make a bunch of these clocks checking for each type of mob, hook them all up to Not gates, and then hook them all up to And gates. Not very compact, but it should get the job done.