Minecraft: turn off certain monsters?

Er
8

Hi, does anyone know how to turn off certain monsters in Minecraft? So maybe with Command? I know that you can take out all monsters with one command, but not all of them should be gone. In addition, the animals should continue to spawn. But I don't want to just go for peaceful either.

gl

/ kill @e [type = chicken]

Er

So do I have to type this command over and over or is that enough?

Er

And are they no longer spawned at all or still and then killed? Or how does it work?

gl

If you run the command, they'll be killed

Er

And can you also prevent spiders from spawning at all, for example?

gl

So you can pack the command in a command block (repeat | absolutely | always active) so that spiders are killed directly when spawning

Er

Thanks. Was very helpful.

gl

With pleasure