local n = minetest.env:get_node(pointed_thing.under)
local nn = n.name
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
- minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer)
- return
+ return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack)
end
end
on_punch = func(pos, node, puncher),
^ default: minetest.node_punch
^ By default: does nothing
- on_rightclick = func(pos, node, clicker),
+ on_rightclick = func(pos, node, clicker, itemstack),
^ default: nil
+ ^ if defined, itemstack will hold clicker's wielded item
+ Shall return the leftover itemstack
on_dig = func(pos, node, digger),
^ default: minetest.node_dig
^ By default: checks privileges, wears out tool and removes node