Minecraft – How could i make a command block message when Zombie died

minecraft-commandsminecraft-java-edition

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.

Related Topic