Skip to content

Instantly share code, notes, and snippets.

@Jordach
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jordach/efcaa2dbc8b3bbe25241 to your computer and use it in GitHub Desktop.
Save Jordach/efcaa2dbc8b3bbe25241 to your computer and use it in GitHub Desktop.
minetest.register_abm({
nodenames = {"mapgen:oak_sapling"},
interval = 2,
chance = 3,
action = function(pos)
pos.y = pos.y - 1
if not minetest.registered_nodes[node].groups.soil then
return
end
if minetest.get_node(pos) == minetest.registered_nodes[node].groups.soil then
minetest.env:remove_node(pos)
pos.x = pos.x - 2
pos.z = pos.z - 2
minetest.place_schematic(pos, minetest.get_modpath("mapgen").."/schematics/mapgen_oak_tree.mts", "random", {{"base:leaves", "mapgen:oak_leaves"}, {"base:tree", "mapgen:oak_log_tree"}, {"base:dirt", "mapgen:dirt"}}, false)
end
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment