summon marker ~ ~ ~ {Tags:["svm_ep.flora_tree","new"]}

execute if predicate svm_ep:chance/67_percent as @e[tag=new] store result score @s svm_ep.p.flora_tree_size1 run random value 1..3
scoreboard players add @e[tag=new] svm_ep.p.flora_tree_size1 2

execute as @e[tag=new] run function svm_ep:system/start_random_rotation_x
execute if biome ~ ~ ~ #svm_ep:has_wood/spruce run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 1
execute if biome ~ ~ ~ #svm_ep:has_wood/birch run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 2
execute if biome ~ ~ ~ #svm_ep:has_wood/jungle run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 3
execute if biome ~ ~ ~ #svm_ep:has_wood/acacia run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 4
execute if biome ~ ~ ~ #svm_ep:has_wood/dark_oak run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 5
execute if biome ~ ~ ~ #svm_ep:has_wood/mangrove run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 6
execute if biome ~ ~ ~ #svm_ep:has_wood/cherry run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 7
execute if biome ~ ~ ~ #svm_ep:has_wood/crimson run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 8
execute if biome ~ ~ ~ #svm_ep:has_wood/warped run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 9
execute if biome ~ ~ ~ #svm_ep:has_wood/azalea run scoreboard players set @n[tag=new] svm_ep.p.flora_climate 10

execute as @s[tag=instant] run tag @n[tag=new] add instant
tag @s remove instant
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=instant] at @s run function svm_ep:power/flora/tree_place/tick
tag @e remove new