36 lines
1005 B
Lua
36 lines
1005 B
Lua
PyuTestMobs = {}
|
|
|
|
PyuTestMobs.ENTITY_BLOOD_AMOUNT = 6
|
|
PyuTestMobs.HUMAN_LIKE_CBOX = {-0.25, -1, -0.25, 0.25, 1, 0.25}
|
|
|
|
PyuTestMobs.create_boss_egg = function(mob_id, desc, texture, addegg, no_creative, craft)
|
|
mobs:register_egg(mob_id, desc, texture, addegg, no_creative)
|
|
|
|
minetest.register_craft({
|
|
output = mob_id,
|
|
recipe = {
|
|
{"", craft, ""},
|
|
{craft, "pyutest_core:emerald_shard", craft},
|
|
{"", craft, ""}
|
|
}
|
|
})
|
|
|
|
local t = mob_id:split(":")
|
|
local mob_name = t[#t]
|
|
|
|
local cage_id = "pyutest_mobs:"..mob_name.."_spawn_cage"
|
|
PyuTestCore.make_node(cage_id, desc:gsub("Spawn Egg", "") .. "Boss Spawner Cage", {
|
|
block = PyuTestCore.BLOCK_BREAKABLE_LONG
|
|
}, {"cage.png"}, {
|
|
drawtype = "glasslike",
|
|
on_rightclick = function(pos)
|
|
mobs:add_mob(vector.add(pos, vector.new(0, 1, 0)), {
|
|
name = mob_id,
|
|
child = false,
|
|
ignore_count = true
|
|
})
|
|
minetest.remove_node(pos)
|
|
end
|
|
})
|
|
end
|