- Code: Select all
minetest.register_node("jeija:wall_button", {
drawtype = "signlike",
tile_images = {"jeija_wall_button.png"},
inventory_image = "jeija_wall_button.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
},
material = minetest.digprop_constanttime(0.3),
})
minetest.register_on_dignode(
function(pos, oldnode, digger)
if oldnode.name == "jeija:wall_button" then
mesecon:receptor_off(pos, "wallbutton")
end
end
)
minetest.register_on_punchnode(function(pos, node, puncher)
if node.name == "jeija:wall_button" then
minetest.env:remove_node(pos)
minetest.env:add_node(pos, {name="jeija:wall_button_off})
nodeupdate(pos)
mesecon:receptor_off(pos)
end
end)
mesecon:add_receptor_node("jeija:wall_button")
(note: off version will be applied also. And I would need to make another rule set for the wall_button correct?)