aboutsummaryrefslogtreecommitdiff
path: root/clientmods
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-01-31 13:18:52 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-03-13 23:56:05 +0100
commit88df9fb5b6c78df9485e8bf3750e2608bd78e14c (patch)
treed823267e244592a7603dc3baffff49818765a853 /clientmods
parent44ca9c9cb2079fa97068adb8ee894c5ae13a9975 (diff)
downloadminetest-88df9fb5b6c78df9485e8bf3750e2608bd78e14c.tar.gz
minetest-88df9fb5b6c78df9485e8bf3750e2608bd78e14c.tar.bz2
minetest-88df9fb5b6c78df9485e8bf3750e2608bd78e14c.zip
Add `get_wielded_item`
Diffstat (limited to 'clientmods')
-rw-r--r--clientmods/preview/init.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua
index db4f28350..2ca4594d3 100644
--- a/clientmods/preview/init.lua
+++ b/clientmods/preview/init.lua
@@ -60,6 +60,28 @@ end)
core.register_on_punchnode(function(pos, node)
print("The local player punched a node!")
+ local itemstack = core.get_wielded_item()
+ --[[
+ -- getters
+ print(dump(itemstack:is_empty()))
+ print(dump(itemstack:get_name()))
+ print(dump(itemstack:get_count()))
+ print(dump(itemstack:get_wear()))
+ print(dump(itemstack:get_meta()))
+ print(dump(itemstack:get_metadata()))
+ print(dump(itemstack:is_known()))
+ --print(dump(itemstack:get_definition()))
+ print(dump(itemstack:get_tool_capabilities()))
+ print(dump(itemstack:to_string()))
+ print(dump(itemstack:to_table()))
+ -- setters
+ print(dump(itemstack:set_name("default:dirt")))
+ print(dump(itemstack:set_count("95")))
+ print(dump(itemstack:set_wear(934)))
+ print(dump(itemstack:get_meta()))
+ print(dump(itemstack:get_metadata()))
+ --]]
+ print(dump(itemstack:to_table()))
print("pos:" .. dump(pos))
print("node:" .. dump(node))
return false