diff options
author | Novatux <nathanael.courant@laposte.net> | 2013-05-06 18:53:15 +0200 |
---|---|---|
committer | proller <proller@github.com> | 2013-10-16 21:58:29 +0400 |
commit | 34e0a0ca0fbb6826ea0c583295f79307b1a754c6 (patch) | |
tree | 25397c2e2d93d5438f35e5cfea83adf446f3cc78 /doc | |
parent | 4e5760a5416cbca6945b1b4484cbd96bea7b250c (diff) | |
download | minetest-34e0a0ca0fbb6826ea0c583295f79307b1a754c6.tar.gz minetest-34e0a0ca0fbb6826ea0c583295f79307b1a754c6.tar.bz2 minetest-34e0a0ca0fbb6826ea0c583295f79307b1a754c6.zip |
Add tool callback
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index f89f71273..cfea3b5c1 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1980,6 +1980,15 @@ Item definition (register_node, register_craftitem, register_tool) eg. itemstack:take_item(); return itemstack ^ Otherwise, the function is free to do what it wants. ^ The default functions handle regular use cases. + after_use = func(itemstack, user, node, digparams), + ^ default: nil + ^ If defined, should return an itemstack and will be called instead of + wearing out the tool. If returns nil, does nothing. + If after_use doesn't exist, it is the same as: + function(itemstack, user, node, digparams) + itemstack:add_wear(digparams.wear) + return itemstack + end } Tile definition: |