Add in glowing spider eyes

This commit is contained in:
oilboi 2020-06-07 11:53:31 -04:00
parent 7c12e371b0
commit 69030c7489
4 changed files with 23 additions and 0 deletions

View File

@ -740,6 +740,26 @@ mobs.register_mob(
}
)
local spider_eyes = {}
spider_eyes.initial_properties = {
visual = "mesh",
mesh = "spider_eyes.b3d",
textures = {"spider_eyes.png"},
pointable = false,
--visual_size = {x = 4, y = 4, z = 4},
}
spider_eyes.glow = -1
spider_eyes.on_step = function(self)
if not self.owner or not self.owner:get_luaentity() then
--self.object:remove()
else
local owner_head_bone = self.owner:get_luaentity().head_bone
local position,rotation = self.owner:get_bone_position(owner_head_bone)
self.object:set_attach(self.owner, owner_head_bone, vector.new(0,0,0), rotation)
end
end
minetest.register_entity("mob:spider_eyes",spider_eyes)
mobs.register_mob(
{
@ -801,6 +821,9 @@ mobs.register_mob(
group_attack = true,
custom_on_activate = function(self)
local eyes = minetest.add_entity(self.object:get_pos(), "mob:spider_eyes")
eyes:set_attach(self.object, "body.head", vector.new(0,0,0), vector.new(0,0,0))
eyes:get_luaentity().owner = self.object
if math.random() > 0.998 then
local obj = minetest.add_entity(self.object:get_pos(),"mob:pig")
local obj2 = minetest.add_entity(self.object:get_pos(),"tnt:tnt")

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB