mobs: add nofollow option so v. dont follow bread
This commit is contained in:
parent
9a866e873e
commit
dfb74cf9e9
|
@ -1438,6 +1438,7 @@ end
|
|||
|
||||
-- should mob follow what I'm holding ?
|
||||
local follow_holding = function(self, clicker)
|
||||
if self.nofollow then return false end
|
||||
|
||||
if mobs.invis[clicker:get_player_name()] then
|
||||
return false
|
||||
|
@ -3913,6 +3914,7 @@ minetest.register_entity(name, {
|
|||
sounds = def.sounds or {},
|
||||
animation = def.animation,
|
||||
follow = def.follow,
|
||||
nofollow = def.nofollow,
|
||||
jump = def.jump ~= false,
|
||||
walk_chance = def.walk_chance or 50,
|
||||
attacks_monsters = def.attacks_monsters or false,
|
||||
|
@ -4321,7 +4323,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
|||
end
|
||||
|
||||
-- can eat/tame with item in hand
|
||||
if follow_holding(self, clicker) then
|
||||
if self.nofollow or follow_holding(self, clicker) then
|
||||
|
||||
-- if not in creative then take item
|
||||
if not mobs.is_creative(clicker:get_player_name()) then
|
||||
|
|
|
@ -1231,6 +1231,7 @@ mobs:register_mob("mobs_mc:villager", {
|
|||
die_loop = false,
|
||||
},
|
||||
follow = mobs_mc.follow.villager,
|
||||
nofollow = true,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
jump = true,
|
||||
|
@ -1247,7 +1248,6 @@ mobs:register_mob("mobs_mc:villager", {
|
|||
clicker = p
|
||||
end
|
||||
end
|
||||
if not clicker then minetest.log("no clicker") end
|
||||
if clicker then
|
||||
mobs:feed_tame(self, clicker, 1, true, true)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue