mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add on_rightclick(pos, node, clicker) callback for nodes
This commit is contained in:
parent
d2b1210376
commit
5bc14e2fe4
2 changed files with 17 additions and 2 deletions
|
@ -942,6 +942,8 @@ minetest.item_place_object(itemstack, placer, pointed_thing)
|
|||
^ Place item as-is
|
||||
minetest.item_place(itemstack, placer, pointed_thing)
|
||||
^ Use one of the above based on what the item is.
|
||||
^ Calls on_rightclick of pointed_thing.under if defined instead
|
||||
^ Note: is not called when wielded item overrides on_place
|
||||
minetest.item_drop(itemstack, dropper, pos)
|
||||
^ Drop the item
|
||||
minetest.item_eat(hp_change, replace_with_item)
|
||||
|
@ -1482,6 +1484,8 @@ Node definition (register_node)
|
|||
on_punch = func(pos, node, puncher),
|
||||
^ default: minetest.node_punch
|
||||
^ By default: does nothing
|
||||
on_rightclick = func(pos, node, clicker),
|
||||
^ default: nil
|
||||
on_dig = func(pos, node, digger),
|
||||
^ default: minetest.node_dig
|
||||
^ By default: checks privileges, wears out tool and removes node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue