How to test if a mob is dead to execute a command?
So i am making a 1.9.4 adventure map but then i spotted an AMAZING one vanilla minecraft command block person called IJAMinecraft! He makes the best commands and one of my favorite one commands was "Entity 303". In one part, about 8 slimes spawns around the Boss and once you shoot them all dead, the boss with execute a title and then teleport you into a platform. This could be very effective in my adventure map and was wondering how to be able to do this.
Best Answer
Have an unconditional, repeating, always active command block with /testfor @a {Inventory:[{id:minecraft:slimeball, Count:8}]}, connected to a conditional, impulse, needs redstone command block with the command you want to run (in your case, the title, I recommend from http://minecraft.tools/en/title.php) and a chain, unconditional, always active command block with the /tp @p x y z command.
Pictures about "How to test if a mob is dead to execute a command?"



How do you test entity in Minecraft?
2. Type the CommandHow do you test for command blocks?
You can test whether there is a certain block at a specific location in the game using the /testforblock command in Minecraft....TestForBlock Command in Minecraft Java Edition (PC/Mac)How do you find a mob with commands?
Rather than spawning them in (and not being able to see where they naturally spawn, their habitats, etc.), it would be cool to have a /locatemob and/or /moblocate command that works as follows: /moblocate <mob/entity>, and the result would simply be the same as the /locate - /locatebiome commands, simply giving you the ...How do you detect mobs?
Depending on how your mobs are spawned, you can choose one of the following ways to detect them:Minecraft: How to detect when a mob dies [1.16+]
More answers regarding how to test if a mob is dead to execute a command?
Answer 2
Have a /scoreboard command with a score for killing slimes within a team then use chain command blocks or comparators to teleport and create the title command.
Another method would be to test for all slimes within the area using a |repeat|unconditional|always active| command block hooked up to a comparator that triggers the title/tp whatnot. The testfor command could be executed by the player or the boss
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pew Nguyen, RODNAE Productions, RODNAE Productions, RODNAE Productions
