Didn't seem to see if I could on the wiki, has anyone tried?

Possibly a command that can convert//replace a cow with a mooshroom? Replace pig with a Pigman? Ect.

Removes one mob and replaces it with another?


No there is no command to replace a mob with another in the current version of vanilla minecraft. This can easily be seen if you check the wiki concerning commands. I would list them here but the list of commands is entirely too long as I understand the ruling of lists here at Arqade to be. If someone corrects me I will gladly include it.

It would seem that in 1.8 this feature will become available through command blocks. Thanks @Mbraedley

  • 5
    This will be possible in 1.8, since it's possible in the snapshots already. I don't think it's been demonstrated yet, but just thinking through it, it should only take 2 command blocks. Not a single command, no, but definitely possible.
    – MBraedley
    Jan 27 '14 at 12:18

As of snapshot 14w07a, this is completely possible and fully supported using the /execute command. The execute command doesn't kill a specified entity, instead, what it does is it runs a command relative to an existing entity. So let's say you wanted to replace all pigs within a certain radius with zombie pigmen. The commands you'd want to use would be as follows: /execute @e[type=Pig,r=50] ~ ~ ~ summon PigZombie ~ ~ ~, /tp @e[type=Pig,r=50] ~ -1 ~. Running those commands at the same time will summon a zombie pigman wherever there is a pig, and then teleport those pigs out of the world.

Before, this could be done for one mob of the "old type" by teleporting the new mob to the old mob, then getting rid of the old mob. The problem is the @e[type=Type] selector will pick any entity of that type. The /execute command runs the specified command for every matching entity, which allows this to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.