+
Spoiler
I am trying to make a pickaxe that automatically smelts whatever it mines, but am having trouble. I have typed this code in the minetest.register_tool:
This just prints something similar to:
and does not add the smelted item.
I have also tried returning "product" instead of "itemstack", but this also does not work as intended; it just removes the tools.
How do I find out the name of the craft result?
Code: Select all
after_use = function(itemstack, user, node, digparams)
local node = node.name
print(node)
local product = minetest.get_craft_result({method = "cooking", width = 1, items = {node}})
print(product)
user:get_inventory():add_item("main", (product))
return itemstack
end
Code: Select all
default:stone
table: 0x0a828580
I have also tried returning "product" instead of "itemstack", but this also does not work as intended; it just removes the tools.
How do I find out the name of the craft result?