minetest.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if node.name == "mesecons_switch:mesecon_switch_off" then
local player_name = clicker:get_player_name()
local mypos = minetest.pos_to_string(pos)
minetest.chat_send_all(player_name .." is right-click on me. I'm located at ".. mypos)
end
end
-- Use switch to on/off and use pick to change the value
minetest.register_tool("nekromod:pick_wood", {
description = "Wooden Pickaxe Weapon",
inventory_image = "default_tool_woodpick.png",
tool_capabilities = {
},
-- Left button mouse
on_use = function(itemstack, user, pointed_thing)
local pos = pointed_thing.under
if not pos then
return itemstack
end
local meta = minetest.get_meta(pos)
minetest.chat_send_all("on_use; x=" .. pos.x .. " y=" .. pos.y .. " z=" .. pos.z)
return itemstack
end,
-- Right button mouse
on_place = function(itemstack, user, pointed_thing)
local pos = pointed_thing
if not pos then
return itemstack
end
minetest.chat_send_all("on_place")
return itemstack
end,
})