Plugin category: [MECH] Suggested name: SlimeBeGone What I want: A plugin that only allows slimes to spawn if in swamp biome and height > 60. Ideas for commands: No commands needed for this plugin. Ideas for permissions: No permissions needed for this plugin. When I'd like it by: Within a week please. Hello, Since Slimes spawn in swamps now, they're significantly easier to find. However, slimes still spawn in the old way as well, meaning random chunks which are predefined as Slime chunks. There's no way to prevent slimes from spawning in these chunks, so if you happen to have built a large base in one, you most likely have a problem with slimes appearing in your base. I'm looking for a plugin that completely disables the "slime chunk" concept, preventing them from spawning in those chunks but still allowing them to spawn in swamps. I'm aware that there's plugins for this, but they require going through every slime chunk and disabling them manually(As well as an SQL database). If anyone can make a plugin that achieves this, it would be greatly appreciated. It doesn't seem something entirely hard to code, but I have no experience with java nor the time to learn atm :/ Thanks in advance
I'm confused. Do you want, Swamps: Slimes on the surface only. Other: No slimes or, Swamps: Slimes on the surface only. Other: Slimes, but not on the surface
Yeah I apologize, I haven't gotten much sleep xD Bump EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code: @EventHandler public void onCreatureSpawn(CreatureSpawnEvent e) { if(e.getEntity() instanceof Slime) { Slime slime = e.getEntity(); if(!Bukkit.getWorld("world").getBiome().equals(Biome.SWAMP) && !slime.getLocation().getBlockY() < 60)) { e.setCancelled(true); Maybe something like that? Its a pseudo code, I'm on my phone atm
I think you did'nt read correctly it was remove pre 1.4 not remove 1.4 it should be Code: @EventHandler public void onCreatureSpawn(CreatureSpawnEvent e) { if(e.getEntity() instaceof Slime) { Slime slime = e.getEntity(); if(Bukkit.getWorld("world").getBiome().equals(Biome.SWAMP) && slime.getLocation().getBlockY() > 60)) { e.setCancelled(true); Now it only spawnes in swampbiome over Y: 60
I just edited my post so it should cancel the event if it's not swamp biome, and the Y location is less than 60. EDIT: Your code would cancel the event if the biome IS swamp biome, that's why there is !Bukkit.getWorld etc..
"if(Bukkit.getWorld("world").getBiome().equals(Biome.SWAMP)" Biome is per block (column of blocks) not per world. Mobs can already do this if you're desperate but it's a bit heavy to use for only this.
I've made this into a simple plugin... I'm kind of surprised no body else has bothered. It needs approval, but: http://dev.bukkit.org/server-mods/slimebegone/
Thank you very much. I'll wait till that gets approved then Err, I thought I would have to wait for approval for a download link to the compiled jar, but it seems to be approved now and theres no compiled jar D: Can you compile it for me please? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
The compiled jar is available under the files tab It shows that two people have downloaded it thus far, so I believe it's been approved too (as far as I understand, both the project and each file must be approved).
Found a bug in it. If a slime that spawned under apropriate conditions follows you to another biome, it wont spawn smaller slimes when you kill it. Same applies for slimes that go down into a cave within swamp biome.