From f7f73c20042940fecc98898a100837de00db9799 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Thu, 15 Oct 2015 00:06:04 +0200 Subject: [PATCH] use spawn_specific to limit spawn number of mobs:pumpking and mobs:pumpboom fix typo --- mods/mobs/api.lua | 2 +- mods/mobs/pumpkins.lua | 24 +++++++----------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index ee146705..ccdf988c 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1447,7 +1447,7 @@ function mobs:explosion(pos, radius, fire, smoke, sound) p.x = pos.x + x p.y = pos.y + y p.z = pos.z + z - if p.y >= 19600 --MFF + if p.y >= -19600 --MFF and data[vi] ~= c_air and data[vi] ~= c_ignore and data[vi] ~= c_obsidian diff --git a/mods/mobs/pumpkins.lua b/mods/mobs/pumpkins.lua index 81b85de7..36786f2b 100755 --- a/mods/mobs/pumpkins.lua +++ b/mods/mobs/pumpkins.lua @@ -127,21 +127,11 @@ minetest.register_node("mobs:pumpboom_spawner", { }) }) -minetest.register_abm({ - nodenames = {"mobs:pumpking_spawner"}, - interval = 300.0, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.add_entity(pos, "mobs:pumpking") - end -}) +--(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height, spawn_in_area) +-- spawn on mobs:pumpking_spawner between 1 and 20 light, interval 300, 1 chance, 1 pumpking_spawner in area up to 31000 in height +mobs:spawn_specific("mobs:pumpking", {"mobs:pumpking_spawner"}, {"air"}, 1, 20, 300, 1, 1, -31000, 31000, true) + +-- spawn on mobs:pumpboom_spawner between 1 and 20 light, 4 interval, 1 chance, 1 pumpboom in area up to 31000 in height +mobs:spawn_specific("mobs:pumpboom", {"mobs:pumpboom_spawner"}, {"air"}, 1, 20, 10, 4, 1, -31000, 31000, true) + -minetest.register_abm({ - nodenames = {"mobs:pumpboom_spawner"}, - interval = 10.0, - chance = 4, - action = function(pos, node, active_object_count, active_object_count_wider) - pos.y = pos.y + 1 - minetest.add_entity(pos, "mobs:pumpboom") - end -})