-2

This question already has an answer here:

I like to play Minecraft and the bats are annoying and tried doing /kill @e [type = bat] then I pressed enter and all entities were killed. It ruined my world! How do I target the all of bats and ONLY the bats without killing anything else?

marked as duplicate by MBraedley, Gigazelle, Tim Stone, Lore Friendly, Niro Jan 27 '18 at 3:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5

Spaces aren't allowed between selectors and their arguments. It'll be killing @e and ignoring everything after the space. Try:

/kill @e[type=bat]

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