Loop chunk

  • 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!

Status
Not open for further replies.

Albert481

Member
Jan 8, 2018
3
0
0
How do I add chunk blocks in a radius of the player? I'm tired of individually adding chunks to {spawnchunks::*}

code_language.skript:
command /addchunkblocks:
    trigger:
        add the chunk at the player to {spawnchunks::*}
        message "Chunk added to list"
 
https://forums.skunity.com/threads/loop-chunks.4091/#post-13604
code_language.skript:
function chunks_in_radius(center: location, radius: number) :: chunks:
    set {_pos} to {_center}
    set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
    loop 2 * {_radius} + 1 times:
        set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius}
        loop 2 * {_radius} + 1 times:
            add chunk at {_pos} to {_chunks::*}
            add 16 to x-coordinate of {_pos}
        add 16 to z-coordinate of {_pos}
    return {_chunks::*}
 
Status
Not open for further replies.