Conditions for slimes to spawn?

Discussion in 'Plugin Development' started by Lodran, Mar 5, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Lodran

    I've written a plugin - creaturebox - and one of the questions that has come up is, once you've made a slime spawner, how do you get it to work?

    I don't have a good answer to the question, because I don't know what the conditions are which allow slimes to spawn.

    I've seen a lot of (old) misinformation in the minecraft forums, but it doesn't look like anyone's actually cracked open the code to find out.

    Could one of you kind folks who is familiar with the minecraft server source take a look for me?
     
  2. Offline

    toadmess

    In the EntitySlime class there's a public method that returns a boolean (it overrides the method in the EntityLivingclass). This method is called when checking if the entity can be spawned in it's current location.

    It's currently returning true if:

    Code:
    (slimeSize == 1 || worldObj.difficultySetting > 0) && rand.nextInt(10) == 0 && someOtherRNG.nextInt(10) == 0 && posY < 16D;
    
    ..so it'll spawn at very low altitudes less than 16, but only very very rarely.

    I think.
     
Thread Status:
Not open for further replies.

Share This Page