-2

I want to kill multiple evil mobs that will ruin my world: zombies, babyzombies, zombievillagers, creepers and zombie pigmen. This is because of the wooden doors.

I had a command: /kill @e[r=100,type=Zombie,type=babyZombie,type=Creeper] but it will only kill the creepers. I put this in a command block with repeat and no redstone needed on.

It didn't work.

How can I get rid of these mobs with command block and NO mods?

1

First of all, babyZombie is not a valid type. Baby zombies are still just zombies.

But to answer the question, using multiple commands is the most straightforward way. Every target selector needs to match for the entity to be selected (and thus killed) and one entity can't be both a zombie and a creeper. In Java 1.12 you can't even use multiple of the same selector (You can in 1.13 or in Bedrock), but that won't help you here. Just use multiple commands.

0

If you really need to do this in one command, another option is to check if the entity isn't every type, except for the ones that you want (e.g. type=!pig,type=!creeper). Pepijn's answer is definitely the simplest though.

0

you need to use multiple command blocks to kill all of them.

first command block:/kill @e[type=Zombie,r=100] second command block:/kill @e[type=zombie_villager,r=100] third command block:/kill @e[type=Creeper,r=100] fourth command block:/kill @e[type=zombie_pigman,r=100]

activate all of these command blocks and all of the mobs that you listed will be killed.

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.