summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorraymoo <raymoo@users.noreply.github.com>2016-10-26 20:24:34 -0700
committerZeno- <kde.psych@gmail.com>2016-10-27 13:24:34 +1000
commit1fd9a07497c45364ed8396653501c6be2a2e2ade (patch)
tree7791f628a724673fc37e0aeb82eec39ff515a8ed /doc
parent198ed60cabd3066977df5360b7b32a6b895ea744 (diff)
downloadminetest-1fd9a07497c45364ed8396653501c6be2a2e2ade.tar.gz
minetest-1fd9a07497c45364ed8396653501c6be2a2e2ade.tar.bz2
minetest-1fd9a07497c45364ed8396653501c6be2a2e2ade.zip
Document item use callbacks (#4668)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index f7fc9ee17..43ff66bb9 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -3593,15 +3593,18 @@ Definition tables
on_place = func(itemstack, placer, pointed_thing),
--[[
^ Shall place item and return the leftover itemstack
+ ^ The placer may be any ObjectRef or nil.
^ default: minetest.item_place ]]
on_secondary_use = func(itemstack, user, pointed_thing),
--[[
^ Same as on_place but called when pointing at nothing.
+ ^ The user may be any ObjectRef or nil.
^ pointed_thing : always { type = "nothing" }
]]
on_drop = func(itemstack, dropper, pos),
--[[
^ Shall drop item and return the leftover itemstack
+ ^ The dropper may be any ObjectRef or nil.
^ default: minetest.item_drop ]]
on_use = func(itemstack, user, pointed_thing),
--[[
@@ -3610,6 +3613,7 @@ Definition tables
inventory, or an itemstack to replace the original itemstack.
e.g. itemstack:take_item(); return itemstack
^ Otherwise, the function is free to do what it wants.
+ ^ The user may be any ObjectRef or nil.
^ The default functions handle regular use cases.
]]
after_use = func(itemstack, user, node, digparams),
@@ -3622,6 +3626,7 @@ Definition tables
itemstack:add_wear(digparams.wear)
return itemstack
end
+ ^ The user may be any ObjectRef or nil.
]]
}