survival/abms.lua

16 lines
398 B
Lua
Raw Normal View History

2015-03-29 16:19:11 -07:00
minetest.register_abm({
nodenames = {"default:sand"},
neighbors = {"group:water"},
interval = 30,
chance = 75,
action = function(pos, node)
local name = minetest.get_node(pos).name
if name == "default:sand" then
2019-02-02 13:34:26 -08:00
if minetest.find_node_near(pos, 3, {"survival:sand_with_food"}) ~= nil then
2015-03-29 16:19:11 -07:00
return
end
minetest.set_node(pos, {name='survival:sand_with_food'})
end
end,
})