-
-
Notifications
You must be signed in to change notification settings - Fork 21
Chunk Generator
So you wanna generate a world with Skript?
Well you came to the right place.
Note
- This will not work for the main/default world. This will only work for worlds created with SkBee's world creator.
- This will not work if your world is auto-loaded by SkBee, so either disable auto loading in the SkBee config, or make sure to disable auto-load for this specific world in the SkBee Worlds config.
Tip
I recommend using SkNoise to generate noise for your biomes/chunks (if you need that)
Ok let's talk about registration. We register our chunk generator so we can later pass it over to our world creator to create a world with our new generator.
This structure has a few entires which are optional as well as a few sections which are optional.
Let's start with the structure:
register chunk generator with id %string%Pretty straight forward here, pick an ID and register your generator, we will later use this with our world creator.
(these are all optional, and are false by default)
vanilla decor = By enabling this, Minecraft will decorate the surface and caves based on what the biome tells it to use.
vanilla structures = By enabling this, Minecraft will generate vanilla structures (vanilla decor needs to be enabled for this to work).
vanilla caves = By enabling this, Minecraft will carve caves for you.
vanilla mobs = By enabling this, Minecraft will spawn mobs in new chunks based on biome specifics.
(These are all optional, but some do rely on others. height gen and block pop require chunk gen)
-
biome gen= Generate the biomes to be placed in the world. Further Reading -
noise gen= This section is used to generate the basic terrain of the world. Further Reading -
surface gen= This section is used to apply the top surface layer on your terrain. Further Reading -
height gen= Tell Minecraft where the highest block in a chunk is for generating structures. Further Reading -
block pop= Used to decorate after initial surface is generated (Structures can be placed during this stage). Further Reading
Now that we have registered our chunk generator, let's apply it to our world creator.
set chunk generator of %worldcreator% to chunk generator with id %string%on load:
if world "mars" is not loaded:
set {_w} to world creator named "mars"
set chunk generator of {_w} to chunk generator with id "mars"
load world from creator {_w}
register chunk generator with id "mars":
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[]
surface 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)
set {_y} to chunkdata highest block y at vector({_x}, 0, {_z})
# Now we set our surface layer
set chunkdata block at vector({_x}, {_y}, {_z}) to red_concrete_powder[]
biome gen:
# Let's give our world a lil mars lookin biome
set chunkdata biome to crimson forest