Instantly share code, notes, and snippets.

anonymous /test_spawn_tree.lua Secret
Created Nov 20, 2015

Embed
What would you like to do?
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