Skip to content

Chunk Generator Biome Gen Section

Shane Bee edited this page Apr 8, 2024 · 3 revisions

In this section, we can determine how biomes will be laid out in our chunks.
This section is called about 1536 times per chunk (dependant on world min/max height).
This step is the first step in chunk generation. When this is called, blocks have not been determined yet.

Note

If this section is omitted, Minecraft will determine biome layout using both vanilla and data pack biomes.

EXPRESSIONS:

Let's talk about some of the available expressions we have that work in this section.

Location:

event-location

The location is used to determine where in the chunk the biome will be positioned.
You can use the values from this location in conjunction with a noise generator to determine which biome to use.

ChunkData Biome:

chunk[ ]data biome

This expression is used to tell the generator which biome you will be using.

EXAMPLE:

In this simple example, we're just passing a single biome for our entire world.

biome gen:
	# Let's give our world a lil mars lookin biome
	set chunkdata biome to warped forest

In this more advanced example, I've created my own biome noise expressions (via reflect and SkNoise) to help determine how my biomes will be placed.

biome gen:
	set {_l} to event-location
	set {_x} to x coord of {_l}
	set {_y} to y coord of {_l}
	set {_z} to z coord of {_l}

	set {_biome} to calculated biome at vector({_x}, {_y}, {_z})
	set chunkdata biome to {_biome} ? plains

Tip

Due to this being called many times per chunk it's good practice to keep heavy calculations to a minimum here.