#give the marker this tag so it can run the previous function with recursing back into this one
tag @s add RunningFunct2

scoreboard players add @s KyuDummy3 1

setblock ~ ~ ~ minecraft:purpur_block
#execute if predicate suhc:50percent run setblock ~ ~ ~ minecraft:gold_block

tp @s ^ ^ ^1
execute at @s[tag=RotateCCW] run tp @s ~ ~ ~ ~7 ~
execute at @s[tag=RotateCW] run tp @s ~ ~ ~ ~-7 ~
execute at @s[tag=RotateUP] run tp @s ~ ~ ~ ~ ~3
execute at @s[tag=RotateDOWN] run tp @s ~ ~ ~ ~ ~-3

#first spawned branch may happen 5% each time the branch moves a block, and every branch after that(and for every branch spawned from it) is a 1% chance each time it moves a block.
execute if predicate suhc:10percent run execute if predicate suhc:50percent run execute as @s[tag=!SpawnFirstBranch] run function zzzzdonotuse:biomecorruption/colorfulcorruption/firstbranch
execute if predicate suhc:10percent run execute if predicate suhc:10percent run execute as @s[tag=SpawnFirstBranch] run function zzzzdonotuse:biomecorruption/colorfulcorruption/firstbranch


execute if predicate suhc:10percent run tag @s add RotateCW
execute if predicate suhc:10percent run tag @s[tag=!RotateCW] add RotateCCW
execute if predicate suhc:10percent run tag @s add RotateUP
execute if predicate suhc:10percent run tag @s[tag=!RotateUP] add RotateDOWN

execute if predicate suhc:10percent run tag @s remove RotateCW
execute if predicate suhc:10percent run tag @s remove RotateCCW
execute if predicate suhc:10percent run tag @s remove RotateDOWN
execute if predicate suhc:10percent run tag @s remove RotateUP


execute as @s[scores={KyuDummy3=..15}] run execute at @s run function zzzzdonotuse:biomecorruption/colorfulcorruption/treebranch2
execute as @s[scores={KyuDummy3=15..}] run kill @s