Why do the bats keep appearing in Minecraft PE when I’ve used the kill command?

Minecraft PE? Yes, yes I know. Anyways, I’ve had this issue a while back (on a different device and world) and stopped playing for a while but it’s reoccurred! I’ve used the kill command (/kill @e [Type=Bat] ) on the other bats in the world and they’re gone. Or so I thought... I went in the house I’m building because I heard a squeak and 2 bats are there flying around like they own the place and squeaking like there’s no tomorrow! I’ve used the command a few times but all they do is resurrect in another part of the house. Also the house is lit up inside. Any of you had or have this problem and/or know how to fix it? Thank you ^~^


The answer to this is that once you run the command, the bats at that current moment in time would be killed but they will spawn after that. A real life analogy to this would be sweeping a floor. Once the floor is dusty, you sweep the floor, yet dust will still come back and settle on the floor afterwards. In the same way, bats can spawn after the command is run.

An easy fix for this would be using a command block and attaching the command block to a clock so that any new bats are immediately killed.

TL:DR:The command only kills bats that exist at the time and does not kill bats that spawn afterwards.