Minecraft – How to kill only donkeys with /kill

minecraft-java-edition

I'm trieing to find a way to kill only donkeys in Minecraft. I tried only one thing (/kill @a donkey), didn't work. Does anyone know how to kill donkeys in Minecraft?

Best Answer

Target selectors allow you to specify a type argument. You'll also need to use @e for entities, rather than @a which is only for players.

The following command should work:

/kill @e[type=donkey]