fixed tamed monsters bug

This commit is contained in:
tenplus1 2015-05-22 20:21:48 +01:00
parent dff36cfbfc
commit bbb82e1306

10
api.lua
View File

@ -1,4 +1,4 @@
-- Mobs Api (20th May 2015) -- Mobs Api (22nd May 2015)
mobs = {} mobs = {}
mobs.mod = "redo" mobs.mod = "redo"
@ -1260,9 +1260,11 @@ function mobs:register_egg(mob, desc, background, addegg)
pos.y = pos.y + 0.5 pos.y = pos.y + 0.5
local mob = minetest.add_entity(pos, mob) local mob = minetest.add_entity(pos, mob)
local ent = mob:get_luaentity() local ent = mob:get_luaentity()
-- set owner if ent.type ~= "monster" then
ent.owner = placer:get_player_name() -- set owner
ent.tamed = true ent.owner = placer:get_player_name()
ent.tamed = true
end
itemstack:take_item() itemstack:take_item()
end end
return itemstack return itemstack