mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-27 19:57:31 +01:00
Enderman will take nodes only below air
This commit is contained in:
parent
42155c6bdc
commit
9b9ee66b00
@ -364,7 +364,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||||||
self._take_place_timer = 0
|
self._take_place_timer = 0
|
||||||
self._next_take_place_time = math.random(place_frequency_min, place_frequency_max)
|
self._next_take_place_time = math.random(place_frequency_min, place_frequency_max)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local takable_nodes = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y-1, z=pos.z-2}, {x=pos.x+2, y=pos.y+1, z=pos.z+2}, mobs_mc.enderman_takable)
|
local takable_nodes = minetest.find_nodes_in_area_under_air({x=pos.x-2, y=pos.y-1, z=pos.z-2}, {x=pos.x+2, y=pos.y+1, z=pos.z+2}, mobs_mc.enderman_takable)
|
||||||
if #takable_nodes >= 1 then
|
if #takable_nodes >= 1 then
|
||||||
local r = pr:next(1, #takable_nodes)
|
local r = pr:next(1, #takable_nodes)
|
||||||
local take_pos = takable_nodes[r]
|
local take_pos = takable_nodes[r]
|
||||||
|
Loading…
Reference in New Issue
Block a user