how to tell if I am the top of the tree?
I'm learning how to make mods, and well playing around with jeija's tutoral. I strip all the leaves off of the trees. so I want to put them back on. but I need to know when I am 2 tree blocks from the top. So my question is how do you tell when I am not on the top of the tree.
This works pretty good, but it is also changing the tree trunks into leaves as well and I don't want it to do that.
how do you find out if and what the blocks are a-round a block?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_abm(
{nodenames = {"default:tree"},
interval = 1,
chance = 10,
action = function(pos)
pos.y=pos.y+math.random(1,3)
pos.x=pos.x+math.random(-3,3)
pos.z=pos.z+math.random(-3,3)
--pos.y=pos.y+1
--minetest.env:remove_node(pos) -- this is what used to get remove all the leaves.
minetest.env:add_node(pos, {name="default:leaves"})
end,
})
This works pretty good, but it is also changing the tree trunks into leaves as well and I don't want it to do that.
how do you find out if and what the blocks are a-round a block?