Advertisement
Chiddix

spawn formula

Feb 17th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. every spawn cycle (every randInt(200,799) ticks when a player is within
  2. 17 blocks of the spawner),
  3. loop 4 times {
  4. if there are 6 or more of the mob type in the 17x9x17 area around the spawner,
  5. skip this spawn cycle
  6. calculate spawnerX = X coordinate of center of spawner - 0.5
  7. calculate spawnerY = Y coordinate of center of spawner - 0.5
  8. calculate spawnerZ = Z coordinate of center of spawner - 0.5
  9. calculate x coordinate of mob = spawnerX + (randDouble() - randDouble()) * 4,
  10. randDouble being a random number between 0 and 1
  11. calculate y coordinate of mob = spawnerY + a random integer between -1 and 1
  12. calculate z coordinate of mob = spawnerZ + (randDouble() - randDouble()) * 4,
  13. randDouble being a random number between 0 and 1
  14. if all of the conditions specific to the mob type are met, spawn the mob {
  15. chicken, cow, mooshroom, pig, sheep, wolf:
  16. block below spawning block is grass
  17. spawning block has a light level of 9 or higher
  18.  
  19. ocelot:
  20. pass a 2/3 random test
  21. block below spawning block is grass or leaves
  22. on layer 63 or higher
  23.  
  24. creeper, enderman, skeleton, spider, cave spider, zombie:
  25. light level 7 or less
  26.  
  27. blaze:
  28. light level 11 or less
  29.  
  30. silverfish:
  31. light level 11 or less, or on Stone blocks
  32. no players within 5 blocks
  33.  
  34. slime:
  35. difficulty is not set to peaceful or slime size is small
  36. either:
  37. spawn block y coordinate is less than 40
  38. the chunk containing the spawn block is a slime chunk (1 in 10 chance)
  39. pass a 1 in 10 random test
  40. or:
  41. swamp biome, layer 51 through 69, light level 7 or less
  42.  
  43. ghast:
  44. pass a 1 in 20 random test
  45.  
  46. squid:
  47. must not collide with any other entities
  48. must be in layer 46-62
  49.  
  50. all except squid and slimes:
  51. must not collide with any blocks or other entities
  52. must not collide with water or lava
  53. }
  54. }
  55. if all 4 mobs failed to spawn, repeat on the next tick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement