Fix mobs spawning 1.5 nodes above the ground

This commit is contained in:
Wuzzy 2020-12-08 01:44:45 +01:00
parent ac782bac90
commit 7abffc5df9
1 changed files with 2 additions and 3 deletions

View File

@ -4000,15 +4000,14 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
end end
end end
-- spawn mob 1/2 node above ground -- tweak X/Y/Z spawn pos
pos.y = pos.y + 0.5
-- tweak X/Z spawn pos
if width_x % 2 == 0 then if width_x % 2 == 0 then
pos.x = pos.x + 0.5 pos.x = pos.x + 0.5
end end
if width_z % 2 == 0 then if width_z % 2 == 0 then
pos.z = pos.z + 0.5 pos.z = pos.z + 0.5
end end
pos.y = pos.y - 1.499
local mob = minetest.add_entity(pos, name) local mob = minetest.add_entity(pos, name)
minetest.log("action", "Mob spawned: "..name.." at "..minetest.pos_to_string(pos)) minetest.log("action", "Mob spawned: "..name.." at "..minetest.pos_to_string(pos))