[Request] Looking for a plugin that removes the pre-1.4 Slime spawn behavior

Discussion in 'Archived: Plugin Requests' started by Kedama, Nov 25, 2012.

  1. Offline

    Kedama

    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
     
  2. Offline

    Codex Arcanum

    So, don't allow slimes to spawn in anything that isn't a swamp?
     
  3. Offline

    Kedama

    Yeah, exactly. Only on the surface in swamps
     
  4. Offline

    Codex Arcanum

    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
     
  5. Offline

    Kedama

    Swamps: Default behavior (Only on the surface)
    Slime chunks: No slimes.
     
  6. Offline

    Kiakaha

    an easier way to say this is.

    Slimes should only spawn IF Swamp biome AND height > 60.
     
  7. Offline

    Kedama

    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.
     
    Last edited by a moderator: May 30, 2016
  8. Offline

    Kedama

    Bumpy bump
     
  9. Offline

    zachoooo

    I'm surprised no one has made this yet, it sounds quite easy...
     
  10. Offline

    Woobie

    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 :p
     
  11. Offline

    ceoepts

    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
     
  12. Offline

    Woobie

    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..
     
  13. Offline

    coldandtired

    "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.
     
  14. Offline

    brinaq

    Yes me too. If I knew how to create plugins, I would do this! Very sorry, but consider this a bump.
     
  15. Offline

    Kedama

    Bump, can anyone do this please?
     
  16. Offline

    Kedama

  17. Offline

    FinalFred

    Kedama likes this.
  18. Offline

    Kedama

    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.
     
    Last edited by a moderator: May 30, 2016
  19. Offline

    ceoepts

    oh :p Did'nt read all only saw that you did'nt really cancel it.
     
  20. Offline

    FinalFred

    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).
     
  21. Offline

    Kedama

    Ah there we go. The files tab wasn't there when I looked :p
    Thank you!
     
  22. Offline

    Kedama

    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.
     

Share This Page