Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_node("mod:name_below", {
- --textures, groups, blah, blah, blah
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
- },
- on_place = function(itemstack, placer, pointed_thing)
- local pos = pointed_thing.above;
- local node = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z});
- if( node ~= nil and node.name ~= "air" and node.name ~= 'mod:name_top') then
- return;
- end
- return minetest.item_place(itemstack, placer, pointed_thing);
- end,
- on_destruct = function(pos)
- local p = {x=pos.x, y=pos.y+1, z=pos.z}
- minetest.env:remove_node(p)
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement