1.15.2 Blaze Spawning in Overworld

Discussion in 'Spigot Plugin Development' started by Ankh, Feb 19, 2020.

  1. I was wondering if it would be possible to make Blazes naturally spawn in the Overworld, in lava pools. Preferably without disrupting natural mob spawning, while allowing them to still spawn normally in the nether. If so, how would one go about doing this?
  2. Theres probably a million ways to do this, one example I can think of:
    - Create a time loop (this way you can spawn blazes over a scheduled time, basically your own game loop) [ex: every 2 minutes]
    - Check the amount of blazes currently in the overworld (to prevent spawning too many blazes)
    - Loop all the loaded chunks in the world, look for a chunk that contains lava
    - Loop blocks in the chunk to find the lava and spawn a blaze.
    #2 ShaneBee, Feb 19, 2020
    Last edited: Feb 19, 2020
    • Agree Agree x 1
    • Useful Useful x 1
  3. to append to the above: loop all LOADED chunks. this may be given but you dont want to loop every chunk in the world.
  4. HAHA, literally as you put this I edited it, because I thought yeah, it may be obvious to SOME but not others.
  5. Interesting, I'll have to try this out. Thanks!

    Just as a question though, won't it use a lot of memory if it's constantly looping through all loaded chunks to look for lava? Also, would it be possible to make it like natural spawning where it won't spawn near a player?
    #5 Ankh, Feb 19, 2020
    Last edited: Feb 19, 2020
  6. To a degree yes, but the Chunk class has a method to check if the chunk contains a certain block data before having to loop the blocks.
    As for near, find a lava block and then you'd have to probably loop players make sure they're more than 24 blocks (or whatever the number is) away.