-
-
Save anonymous/255b35cd1296be811c78 to your computer and use it in GitHub Desktop.
Spawn tree test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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