mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add get_wielded_item
This commit is contained in:
parent
44ca9c9cb2
commit
88df9fb5b6
15 changed files with 92 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue