Help with block regeneration

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

ZushiYum

Member
Apr 5, 2025
3
0
1
Hello so i need help making a area that randomly generates brown carpet and mostly air from the coordinates 34, 147, 19 to 21, 147, 27 i will be greatfull for any advice or help
 
use perlin noise, it work pretty well and you can find a good example with a little googling.
also to set blocks set block at location(50, 50, 50, "world") to dirt <-- should work

or if you just want to modify this (may or may not work, I have not tested it yet)
Code:
command /goldterrain:
    trigger:
        set {_size} to 50 # size of the terrain (50x50)
        set {_scale} to 10 # smoothness (higher = smoother terrain)
        set {_amplitude} to 10 # height variation

        loop {_x} from 0 to {_size}:
            loop {_z} from 0 to {_size}:
                set {_value} to (loop-value-1 + 0.1) / {_scale}
                set {_value2} to (loop-value-2 + 0.1) / {_scale}
                set {_noise} to sin({_value}) + cos({_value2})

                set {_y} to round({_noise} * {_amplitude}) + 64

                set block at location(loop-value-1, {_y}, loop-value-2, "world") to gold block