Skip to content

Instantly share code, notes, and snippets.

Created November 20, 2015 00:38
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 anonymous/255b35cd1296be811c78 to your computer and use it in GitHub Desktop.
Save anonymous/255b35cd1296be811c78 to your computer and use it in GitHub Desktop.
Spawn tree test
local treedef = {
axiom="FFFFFAFFBF",
rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
trunk="default:tree",
leaves="default:leaves",
angle=30,
iterations=2,
random_level=0,
trunk_type="single",
thin_branches=true,
fruit_chance=10,
fruit="default:apple"
}
core.register_chatcommand("spawn_tree", {
params = "", description = "Spawns tree at player position",
func = function(name, param)
local pos = minetest.get_player_by_name(name):getpos()
minetest.chat_send_player(name, "Spawning tree at " .. minetest.pos_to_string(pos)
.. ", please wait")
minetest.spawn_tree(pos, treedef)
return true, "successfully spawned"
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment