sussy imposters no longer spawn underwater
This commit is contained in:
parent
5233a3aa6f
commit
49cf5f16f9
@ -543,21 +543,25 @@ minetest.register_abm({
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = 100,
|
chance = 100,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
local light = minetest.get_node_light(pos)
|
-- avoid spawning inside liquids
|
||||||
local time = minetest.get_timeofday()
|
if minetest.registered_nodes[minetest.get_node(pos).name].liquidtype == "none" then
|
||||||
if light <= 12 and time >= 0.2 and time <= 0.8 then
|
|
||||||
local entities = minetest.get_objects_inside_radius(pos, 20)
|
local light = minetest.get_node_light(pos)
|
||||||
local bat_count = 0
|
local time = minetest.get_timeofday()
|
||||||
for _, entity in pairs(entities) do
|
if light <= 12 and time >= 0.2 and time <= 0.8 then
|
||||||
if entity:get_entity_name() == "amogus_entities:sussy_imposter" then
|
local entities = minetest.get_objects_inside_radius(pos, 20)
|
||||||
bat_count = bat_count + 1
|
local bat_count = 0
|
||||||
if bat_count >= 3 then
|
for _, entity in pairs(entities) do
|
||||||
return
|
if entity:get_entity_name() == "amogus_entities:sussy_imposter" then
|
||||||
end
|
bat_count = bat_count + 1
|
||||||
end
|
if bat_count >= 3 then
|
||||||
end
|
return
|
||||||
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user