diff options
author | sfan5 <sfan5@live.de> | 2021-10-25 20:30:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 20:30:27 +0200 |
commit | 660e63dbae5901f8178b39ab40e6f770b8d7a215 (patch) | |
tree | 6b17279e1583716684b9d97bb8d56c8e7b8655f4 /doc/lua_api.txt | |
parent | d4b89eb106220f43838b039b13a0e356d366c259 (diff) | |
download | minetest-660e63dbae5901f8178b39ab40e6f770b8d7a215.tar.gz minetest-660e63dbae5901f8178b39ab40e6f770b8d7a215.tar.bz2 minetest-660e63dbae5901f8178b39ab40e6f770b8d7a215.zip |
Fix item duplication if player dies during interact callback (alternative) (#11662)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r-- | doc/lua_api.txt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 69ac55493..e47df4686 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -5421,7 +5421,7 @@ Inventory * `minetest.remove_detached_inventory(name)` * Returns a `boolean` indicating whether the removal succeeded. * `minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)`: - returns left over ItemStack. + returns leftover ItemStack or nil to indicate no inventory change * See `minetest.item_eat` and `minetest.register_on_item_eat` Formspec @@ -7542,12 +7542,15 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and on_place = function(itemstack, placer, pointed_thing), -- When the 'place' key was pressed with the item in hand -- and a node was pointed at. - -- Shall place item and return the leftover itemstack. + -- Shall place item and return the leftover itemstack + -- or nil to not modify the inventory. -- The placer may be any ObjectRef or nil. -- default: minetest.item_place on_secondary_use = function(itemstack, user, pointed_thing), -- Same as on_place but called when not pointing at a node. + -- Function must return either nil if inventory shall not be modified, + -- or an itemstack to replace the original itemstack. -- The user may be any ObjectRef or nil. -- default: nil @@ -7559,8 +7562,8 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and on_use = function(itemstack, user, pointed_thing), -- default: nil -- When user pressed the 'punch/mine' key with the item in hand. - -- Function must return either nil if no item shall be removed from - -- inventory, or an itemstack to replace the original itemstack. + -- Function must return either nil if inventory shall not be modified, + -- 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. |