TenPlus1 wrote:Was thinking of using this in Ethereal, hope it helps (any water beside or above torch drops torch):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_abm({
nodenames = {"default:torch"},
neighbors = {"default:water_source", "default:water_flowing"},
interval = 1, chance = 1,
action = function(pos, node)
local pos0 = {x=pos.x-1,y=pos.y,z=pos.z-1}
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
if #minetest.find_nodes_in_area(pos0, pos1,
{"default:water_source", "default:water_flowing"}) > 0 then
minetest.set_node(pos, {name="default:water_flowing"})
minetest.add_item(pos, {name = "default:torch"})
end
end,
})
This is perfect!!!!
Recipe for water only torch???
- Code: Select all
minetest.register_abm({
nodenames = {"xxxxmod:water_torch"},
neighbors = {"default:water_source", "default:water_flowing"},
interval = 1, chance = 1,
action = function(pos, node)
local pos0 = {x=pos.x-1,y=pos.y,z=pos.z-1}
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
if #minetest.find_nodes_in_area(pos0, pos1,
{"default:water_source", "default:water_flowing"}) == 0 then
minetest.set_node(pos, {name="default:water_flowing"})
minetest.add_item(pos, {name = "xxxxmod:water_torch"})
end
end,
})