#TreeAssist

1 messages · Page 1 of 1 (latest)

swift obsidian
#

w

#
function chain(b: block, n: integer):
    wait 1 tick
    if {_n} is less than 50:
        add 1 to {_n}
        loop blocks in radius 3 around {_b}:
            if loop-block is any log:
                loop blocks above loop-block:
                    loop-block-2 is air:
                        block above loop-block-2 is air
                        exit 1 loop
                    exit 1 loop
                loop blocks above loop-block:
                    loop-block-2 is any leaves
                    chain(loop-block-1, {_n})
                    break loop-block-1
                    wait 10 tick
              
on break:
    player's gamemode is survival
    if event-block is any log:
        loop blocks above event-block:
            set {_l} to 0
            if loop-block is any leaves:
                loop all blocks in radius 2 of loop-block:
                    loop-block-2 is any leaves
                    add 1 to {_l}
                {_l} > 7
                set {_tree} to true
        if {_tree} is true:
            chain(event-block, 0)```
#

so it breaks all the logs, but how would i make it break the leaves too