Lots of people have asked questions about how to stop mobs from spawning, but the answers are almost always to /kill them all. This is not what I want. I don't know if this is possible, but using scoreboards, gamerule, whatever, I want to stop bats from spawning in the first place. This way, somebody can use mobs like bats without them dying.
I know doMobSpawning false is a gamerule I could use, but that stops ALL mobs from spawning. It's likely relevant to note that this is on a minecraft realm, and while that gamerule is on, there's a setting that makes hostile mobs not spawn on their own while passive mobs do. Sadly, bats are considered passive despite how annoying they are. xD
I know also that this likely isn't possible, I'm just seeing if anyone knows a way. Again, no /kill involved. (Unless is somehow doesn't kill pre-existing bats… using tags? hm. If there's an NBT tag for having spawned in a spawn egg, I can use that. Thanks!)
Minecraft – Stopping bats from spawning in vanilla minecraft–Without killing them
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – way to stop mobs pick up blocks mod for Forge/FTB
- Minecraft – Preventing Iron golems from spawning outside the spawner platform
- Minecraft – How to make your minecraft not spawn hostile mobs but spawning friendly mobs and still get hungry
- Minecraft – Increasing xp dropped by mobs
- Minecraft – How to farm creepers for XP without them exploding
- Minecraft – way to effectively prevent phantoms from spawning (1.14)
Best Answer
There isn't a tag for being spawned by a spawn egg, but you can give entities your own tags with custom spawn eggs:
Now you just need to kill all bats that don't have the "
dontkillmepls
" tag. Or, even better, teleport them to y=-65, where they are deleted instantly, without animation and sound.