local modname = minetest.get_current_modname() blockgame.register_abm({ label = "make unsupported leaves fall", nodenames = { modname .. ":leaves_alive", modname .. ":leaves_growing", }, interval = 5, chance = 4, action = function (pos, node) local is_supported = false blockgame.flood_fill(pos, function (pos, distance) local nodename = minetest.get_node(pos).name if blockgame.item_matches(nodename, {"group:supports_leaves"}) then is_supported = true return false end if blockgame.item_matches(nodename, {"group:extends_leaves_support"}) then return true end end, 3) if not is_supported then minetest.set_node(pos, {name = modname .. ":leaves"}) minetest.check_for_falling(pos) -- TODO: send out event here that makes nearby leaves check if they're unsupported as well? end end, })