Chunk Generator Noise Gen Section - ShaneBeee/SkBee GitHub Wiki
Time to generate a chunk.
This section is called once per chunk.
EXPRESSIONS:
Let's look at some available expression you can use in this section.
ChunkData Biome:
chunk[ ]data biome at %vector%
This expression is used to get a biome at a specific point in the chunk.
You may want this to decide which block to place.
The vector represents a position in the chunk not a position in the world. (ie: x/z values are from 0-15)
ChunkData Block:
chunk[ ]data block[data] at %vector%
This expression is used to set a block in a chunk during generation.
Same as the biome expression, the vector represents a position in the chunk not in the world.
ChunkData Blocks:
chunk[ ]data block[data]s (between|within) %vector% (and|to) %vector%
Similar to the ChunkData Block expression, this can be used to quickly fill a bunch of blocks at once.
Same as the above expression, the vector represents a position in the chunk not in the world.
ChunkData Chunk X/Z:
chunk[ ]data chunk (x|z)
This expression is used to the get X/Z coordinations of a chunk.
You can multiply this number by 16 to help get where in the world a block is located.
This can be used to help with noise generation.
EXAMPLES:
Simple Example:
In this example we're simply filling the underground layers with red concrete and setting the top surface layer to red concrete powder.
noise gen:
loop integers from 0 to 15:
loop integers from 0 to 15:
set {_x} to (loop-number-1)
set {_z} to (loop-number-2)
# This is a custom expression I have created in my own script, this is not from SkBee
# This is just meant to give you an idea of how noise works
set {_n} to block noise at vector({_x} + (chunkdata chunk x * 16), 1, {_z} + (chunkdata chunk z * 16))
# Now we set the blocks from 0 to our noise level filling in our world
set chunkdata blocks within vector({_x}, 0, {_z}) and vector({_x}, {_n}, {_z}) to red_concrete[]
Visual:
Here is how it looks in the world.
Complex Example:
In this example we're doing a little bit more work.
Again using noise maps to be able to determine where blocks are going.
Here we're going to have some ocean area and some higher mountains.
For the custom biome noise expression, you can find it on my Snippets repo.
noise gen:
loop integers between 0 and 15:
loop integers between 0 and 15:
set {_x} to (loop-number-1)
set {_z} to (loop-number-2)
set {_n} to block noise at ({_x} + (16 * chunkdata chunk x)), ({_z} + (16 * chunkdata chunk z))
set {_top} to {_n} if {_n} > 64 else 64
# Fill stone
set chunkdata blocks between vector({_x},-64,{_z}) and vector(({_x}),({_n}),({_z})) to stone[]
# Fill water
if {_n} < 61:
set chunkdata blocks between vector({_x},{_n} + 1,{_z}) and vector(({_x}),61,({_z})) to water[]
Visual:
Here is how it looks in game: