Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_tool("industry:treetap", {
description = "Tree Tap",
inventory_image = "treeTap.png",
on_use = function(itemstack, pointed_thing)
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
local node = minetest.env:get_node(pos)
local node_name = node.name
-- nodePos = minetest.get_pointed_thing_position(pointed_thing, above)
-- node = minetest.env:get_node(nodePos)
if (node_name ~= "industry:rubbertreefull") then return end
local stickyResinPos = nodePos
stickyResinPos.z = stickyResinPos.z + 1
minetest.env:add_item(stickyResinPos, "industry:stickyresin")
minetest.env:add_node(nodePos, "industry:rubbertree")
end
})
, show you the error:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
21:24:15: ERROR[main]: ServerError: LuaError: error: ...ome/blake/.minetest/mods/minetest/industry/tools.lua:6: bad argument #1 to 'get_node' (table expected, got nil)
And tell you that this error is thrown when I left click a 'industry:rubbertreefull' node. Please don't reply with a mod that already has it implemented, because I'd like for this mod to be entirely mine. :) I've tried several things to get it to work, but it always ends the same - with the game freezing and an error thrown. If you need further details, just ask. Thanks!