bamboo crop

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Skript doesn't have a grow event for bamboo, so it's not really straightforward.
There are ways to do it, but they can be very laggy and demanding on the server.

C-like:
command /check:
    trigger:
        set {_world} to player's world
        set {_chunks::*} to all loaded chunks in {_world} # Get all loaded chunks in the player's world
       
        loop {_chunks::*}:
            set {_chunk} to loop-value
           
            # Quick scan to find and process only bamboo blocks
            loop all blocks in {_chunk}:
                if loop-block is bamboo: # Only process bamboo blocks
                    set {_block} to loop-block
                    set {_height} to 1
                    set {_currentBlock} to {_block}
                   
                    # Calculate the height of the bamboo stack
                    while block above {_currentBlock} is bamboo:
                        add 1 to {_height}
                        set {_currentBlock} to block above {_currentBlock}
                   
                    # If the bamboo is taller than a certain height, automatically harvest it
                    if {_height} is greater than 3: # Adjust this height as needed
                        while {_height} is greater than 1:
                            break block at {_currentBlock} # Harvest the bamboo above the first block
                            remove 1 from {_height}
                            set {_currentBlock} to block below {_currentBlock}
                        send "Bamboo at %location of {_block}% has been automatically harvested!" to player

This method works, but as mentioned, it can cause performance issues, especially on larger servers.
 
Last edited: