I've updated this mod to use the minetest_game leafdecay API, since the game doesn't use ABMs anymore for this.
Of particular note to server owners/admins/moderators, and perhaps players in general: this leaf decay API only works if you *dig* a trunk, because it needs to set decay timers on the trees' leaves, so if you need to use Worldedit to bulk-remove a tree's trunk to trigger the leaves to decay, you need to use something like this:
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
//luatransform if minetest.get_node(pos).name == "moretrees:willow_trunk" then minetest.dig_node(pos) end
You could still `//replace <trunk> air` if you want to, but then you'll need to //replace the leaves and any "fruit" items as well.
Replace the "moretrees:willow_trunk" with the name you actually want to delete, of course. This also has the side effect of causing fruit items (including pine cones, acorns, etc) to drop out as items as they and the leaves decay, in addition to the occasional sapling.