aboutsummaryrefslogtreecommitdiff
path: root/clientmods/preview
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-05-06 20:12:44 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-05-06 21:12:44 +0200
commit5ebf8f945050e9c74a3bb6784a0844d1fb68bdff (patch)
tree474c9f798c7624c659dd16aa11a4d097cd16b5b4 /clientmods/preview
parent6658ad3d94c053eeed12bb79e255cdfa46831e19 (diff)
downloadminetest-5ebf8f945050e9c74a3bb6784a0844d1fb68bdff.tar.gz
minetest-5ebf8f945050e9c74a3bb6784a0844d1fb68bdff.tar.bz2
minetest-5ebf8f945050e9c74a3bb6784a0844d1fb68bdff.zip
[CSM] add `on_item_use` (#5544)
Diffstat (limited to 'clientmods/preview')
-rw-r--r--clientmods/preview/init.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua
index fb606b3f4..821f7c714 100644
--- a/clientmods/preview/init.lua
+++ b/clientmods/preview/init.lua
@@ -22,6 +22,13 @@ core.register_on_placenode(function(pointed_thing, node)
return false
end)
+core.register_on_item_use(function(itemstack, pointed_thing)
+ print("The local player used an item!")
+ print("pointed_thing :" .. dump(pointed_thing))
+ print("item = " .. itemstack:get_name())
+ return false
+end)
+
-- This is an example function to ensure it's working properly, should be removed before merge
core.register_on_receiving_chat_messages(function(message)
print("[PREVIEW] Received message " .. message)