Is there an edit to the game files that I can do to stop bats from spawning in minecraft? I would guess that I can change something in the minecraft.jar file but I am not really sure how and what to do.
-
1possible duplicate of How can I remove Endermen from the game?– EnderCommented Aug 11, 2014 at 9:44
-
1I disagree that this is a dupe. The other question asks about a different specific mob and the answers will not help in this situation.– shanodinCommented Aug 19, 2014 at 3:37
2 Answers
You can (depending on your version) use a command block and trigger it on a one second redstone clock. You just program the block to:
/kill @e[type=nameofmobtokill]
So in your case:
/kill @e[type=bat]
There's no need for that to execute on every tick, but it's up to you to figure out how to make sure the command block remains chunk loaded (placing it at the world's spawn point should probably do it).
Credit to stef for mentioning this in an answer to a nearly identical question about accomplishing the same with endermen.
However, you can't craft command blocks, so you have to be in creative mode both to obtain and remove one, as well as make changes to their programming. They can be placed in survival, but any productive use has to be arranged through creative mode.
Without using a command block, or a mod designed to control how / when / where mobs spawn, there's no practical or effective way to accomplish it. Bats are tricky in particular because they can spawn in any single vacant block where the light level is sufficiently low. Zombies and Skeletons need at least a two-block high area in order to spawn.
You could write your own mod to prevent them from spawning, I don't think it would be entirely difficult. I'd recommend going with what's available in Forge since it's very well-maintained and supported, plus its wide-use lets lots of others enjoy your mod if you wish to share it. It'd probably be a great exercise in larning how things work, sort of like a 'hello world' mod.
-
shouldn't this question be closed as duplicate of said nearly identical question? I mean, bats, endermen, shall we have the same question about each other kind of mob Minecraft has to offer?– ZommuterCommented Aug 11, 2014 at 8:14
-
@Zommuter The problem with that is that if someone searches "how to get rid of bats in Minecraft" what are the chances that the answer to "How to get rid of Endermen in Minecraft" is going to come up, or that they'll click it thinking it will solve their issue? My guess is low on both counts.– PharapCommented Aug 11, 2014 at 12:14
-
1@Zommuter But then you'd have to either delete or change the semantics of the question about getting rid of Endermen. You could suggest to the OP to make this question generic, but even if they accept it won't get rid of the issue where someone searches "How to get rid of bats in Minecraft" and doesn't get "How to get rid of specific mobs in Minecraft". Personally I think this is down to a lack of a feature on Arqade/SE's part: the ability to route specific question searches to generalised answers.– PharapCommented Aug 11, 2014 at 12:25
-
1@Pharap Indeed. Sounds like you got an idea for a feature-request– ZommuterCommented Aug 11, 2014 at 12:29
-
1I almost closed it, but the semantics of the question seemed different enough to let it remain open, or at least not be closed by one person. You can't always anticipate common questions like "How do I get rid of a certain type of mob?" and give a canonical answer that applies universally, so I just try to make sure they're linked together (which they are) for now. There are some changes in the oven to handle duplicates much better, such as accepting an answer that mostly just links to another question automatically marks the duplicate. We're working on it.– user43038Commented Aug 11, 2014 at 12:42
There's no way to ban certain mobs without banning all of them UNLESS you use a mod. I googled around a bit and found this one, but I've never used it so I can't say whether or not it works.
If you're not interested in using mods, bats only spawn in darkness, so you could try lighting up everything.