Add in glowing spider eyes
This commit is contained in:
parent
7c12e371b0
commit
69030c7489
@ -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")
|
||||
|
BIN
mods/mob/models/22i's blends/spider_eyes.blend
Normal file
BIN
mods/mob/models/22i's blends/spider_eyes.blend
Normal file
Binary file not shown.
BIN
mods/mob/models/spider_eyes.b3d
Normal file
BIN
mods/mob/models/spider_eyes.b3d
Normal file
Binary file not shown.
BIN
mods/mob/textures/spider_eyes.png
Normal file
BIN
mods/mob/textures/spider_eyes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Loading…
x
Reference in New Issue
Block a user