spawn_example.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[ Spawn Template, defaults to values shown if line not provided
  2. mobs:spawn({
  3. name = "",
  4. - Name of mob, must be provided e.g. "mymod:my_mob"
  5. nodes = {"group:soil, "group:stone"},
  6. - Nodes to spawn on top of.
  7. neighbors = {"air"},
  8. - Nodes to spawn beside.
  9. min_light = 0,
  10. - Minimum light level.
  11. max_light = 15,
  12. - Maximum light level, 15 is sunlight only.
  13. interval = 30,
  14. - Spawn interval in seconds.
  15. chance = 5000,
  16. - Spawn chance, 1 in every 5000 nodes.
  17. active_object_count = 1,
  18. - Active mobs of this type in area.
  19. min_height = -31000,
  20. - Minimum height level.
  21. max_height = 31000,
  22. - Maximum height level.
  23. day_toggle = nil,
  24. - Daytime toggle, true to spawn during day, false for night, nil for both
  25. on_spawn = nil,
  26. - On spawn function to run when mob spawns in world
  27. on_map_load = nil,
  28. - On map load, when true mob only spawns in newly generated map areas
  29. })
  30. ]]--
  31. -- NPC
  32. mobs:spawn({
  33. name = "mobs_npc:npc",
  34. nodes = {"default:brick"},
  35. neighbors = {"default:grass_3"},
  36. min_light = 10,
  37. chance = 10000,
  38. active_object_count = 1,
  39. min_height = 0,
  40. day_toggle = true,
  41. })
  42. -- Igor
  43. mobs:spawn({
  44. name = "mobs_npc:igor",
  45. nodes = {"mobs:meatblock"},
  46. neighbors = {"default:brick"},
  47. min_light = 10,
  48. chance = 10000,
  49. active_object_count = 1,
  50. min_height = 0,
  51. day_toggle = true,
  52. })
  53. -- Trader
  54. mobs:spawn({
  55. name = "mobs_npc:trader",
  56. nodes = {"default:diamondblock"},
  57. neighbors = {"default:brick"},
  58. min_light = 10,
  59. chance = 10000,
  60. active_object_count = 1,
  61. min_height = 0,
  62. day_toggle = true,
  63. })