How do I kill all mobs with a custom name?
I'm making a minigame on a server, I have command blocks to summon a lot of zombies. All the zombies who are summoned are given the custom name of 'Infected'.
I need a way so when the game is done all the remaining Infected get killed by command blocks. I have tried setting it up so when the minigame is done a command block changes it to peaceful and then to normal again but on servers changing difficulty never really works. The server i'm working on is at 1.7.10. is this even possible in 1.7.10? I know you don't have the @e command.
Best Answer
Use a couple of command blocks to summon thrown potions to kill the zombies:
/summon ThrownPotion X Y Z {Potion:{tag:{CustomPotionEffects:[{Id:6,Amplifier:20}]}}}
Summon them wherever the zombies can get, and it should kill them. I tried this and it seems to work, but if you encounter any problems, please comment and I will look into it.
Pictures about "How do I kill all mobs with a custom name?"
What is the command to kill all mobs?
The first and the basic way to use the command is to kill all the entities of the game: Open the chatbox by pressing T on your keyboard. Type in the command: /kill @e and hit Enter. Every entity in the game, including yourself, dies after executing the command.How do you give mobs custom names?
To find the entity name, type /summon and then press TAB to get a full list of entities. where ENTITY is your entity. To kill them at the coordinates, simply use the X, Y, and Z, tags. Be aware that without an area limiter such as r or dx/dy/dz , all squids will be killed.How do you kill an entity in Minecraft with a name?
Minecraft kill command But should you want to kill another player, use \u201c/kill <player>\u201d. And to kill a certain type of mob, \u201c/kill @e[type=mobType]\u201d.Kill Command Explained
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Tara Winstead, Brett Sayles, Albert Nunez, Garvin St. Villier