This commit is contained in:
Kacper Kostka
2023-02-06 05:22:35 +01:00
parent f62082d9c6
commit 5233a3aa6f
3 changed files with 62 additions and 16 deletions

View File

@@ -536,6 +536,30 @@ minetest.register_decoration({
schematic = "/schematics/STATUE_GIANT.mts",
})
minetest.register_abm({
label = "Spawn Imposter",
nodenames = {"air"},
neighbors = {"group:stone"},
interval = 30,
chance = 100,
action = function(pos)
local light = minetest.get_node_light(pos)
local time = minetest.get_timeofday()
if light <= 12 and time >= 0.2 and time <= 0.8 then
local entities = minetest.get_objects_inside_radius(pos, 20)
local bat_count = 0
for _, entity in pairs(entities) do
if entity:get_entity_name() == "amogus_entities:sussy_imposter" then
bat_count = bat_count + 1
if bat_count >= 3 then
return
end
end
end
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
end
end,
})
-- wtf is this??