How could i make a command block message when Zombie died?
I am creating a custom map in which I have a command block but I don't know how to make it display a message when a Zombie dies.
If anyone knows how to do that, it'd be great if you told me.
Best Answer
You might want to do
/scoreboard objectives add Death dummy
Then run a repeat command block with this command:
/scoreboard players set @e[type=Zombie] Death 1 {Health:0.0f}
And another repeat command block with
/testfor @e[type=Zombie,score_Death=1]
pointing into a conditional chain always active command block with
/tellraw @a ["",{"text":"A Zombie Has died!","color":"white"}]
or whatever you want the death message to be.
Pictures about "How could i make a command block message when Zombie died?"



How do you make a custom death message in Minecraft?
How to Enter the CommandHow do you make a command block give you a message?
A command block is a block that can execute commands. Because it cannot be obtained or edited in Survival mode without cheats, it is primarily used on multiplayer servers, in Creative worlds, and custom maps.3 Deadly Command Blocks (Minecraft PE)
More answers regarding how could i make a command block message when Zombie died?
Answer 2
I believe that it's impossible to do using just the vanilla Minecraft and a command block. However, you can count the number of zombies killed by each players by using the Scoreboard. It is a very complicated and complex tool to use and might be what you needed in the end.
For example, scoreboard objectives add killZombie stat.killEntity.Zombie Zombies Killed then scoreboard objectives setdisplay sidebar killZombie will show to everyone, to the right of their screen, the number of zombies killed by every players. Then, in a command block, you can use /testfor @p[score_killZombie_min=10] to see if a player killed at least 10 zombies.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Matthias Groeneveld, Ono Kosuki, Alesia Kozik, Chris F
