Creating a Pack - astrsh/TerraWiki GitHub Wiki

This guide will outline the process of creating a new Terra configuration pack from the beginning. If you haven't already, please read the Config Development Introduction for more information before continuing.

While Terra has a very intuitive config system, this does not mean creating a comprehensive world generator is a simple task! Every aspect of Terra world generation is defined somewhere in a config pack, meaning building a pack from scratch requires defining all behaviours pertaining to world generation. Pack development can however also be very rewarding. Being able to create, experiment, and modify worlds to your exact specification can be both a creative and enjoyable exercise.

This multi-part guide will provide a foundation of knowledge required to build your own world generator in Terra from scratch, while remaining as beginner friendly as possible. If you get stuck at any stage, or need some clarification, be sure to ask for help if you need it! We'll be happy to help you in our Discord server.

If you wish to modify an existing pack rather than creating your own from scratch, please refer to this guide instead.

As explained in the Config Development Introduction, addons are where the majority of Terra's functionality from. So you might be thinking -

Thankfully, we won't need to scramble around downloading all the necessary addons to get started with world generation, as We will slowly introduce each core addon in this guide when the functionality is required.

Setting up a New Pack

Every Terra configuration pack will start with something called a Pack Manifest. A pack manifest defines basic information about a config pack that is required for it to load correctly, such as who made it, what version the pack is, and what dependencies such as addons are required for it to work.

Creating the Files

The following steps will walk you through how to create a bare-bones config pack from scratch. Click each step to expand for instructions.

1. Create a pack directory that will store all the files for your new pack.
  • Navigate to your packs directory (not to be confused with pack directory), this will be a folder contained in the Terra directory (covered in Config Development Introduction) under the name packs.

  • Once you have navigated there, create a new folder. The name of this folder is not important and could be anything you'd like it to be, but for the sake of explanation we will name the folder tutorial.

You should now have a folder with the following path:

  • Fabric - /config/Terra/packs/tutorial

  • Bukkit - /plugins/Terra/packs/tutorial

From now on we will refer to this folder as the pack directory.


2. Now that you have a pack directory, you will need to create a pack manifest.
  • Create a new config file(?) within your pack directory called pack.yml - this file is your pack manifest.

  • Open the pack manifest in your editor of choice and add the following line to the file:

    id: <Pack Name>

    If your editor has a built-in file explorer, then you can simply open the pack directory as a project instead of opening singular files.

  • Replace <Pack Name> with whatever you'd like to use as a pack ID. It's convention to use all uppercase characters and replace spaces with underscores _. For this guide we will use the ID TUTORIAL.

    Here is an example of what your pack manifest should look like:

    id: TUTORIAL

    During world creation, this is the ID that will be used to tell Terra what pack to use when generating.

    Optionally, you can also add yourself as an author, as well as specify a version for your pack like so:

    id: TUTORIAL
    author: Astrash # Optional
    version: 1.0.0  # Optional

You should now have a config file called pack.yml inside your pack directory, which contains a pack ID, and optionally an author and or version.


3. After creating a pack manifest, you will need to create a biome configuration so the generator will have a biome to generate.
  • Create a new folder within your pack directory called biomes.

  • Within the new biomes folder, create a new config file with a name of your choice. This file is your biome configuration.

    The file name of a biome configuration doesn't matter (aside from the extension) but generally you'll want to name it after the name of your biome for organization - for this tutorial we will call the file first_biome.yml.

  • Add the following lines to your new biome configuration:

    id: <Biome ID>
    vanilla: <Vanilla Biome ID>
    noise-equation: "-y + <Base Height>"
    palette:
      - "BLOCK:minecraft:<Block ID>": 255
  • Replace the placeholders (the things surrounded by angle brackets < >) with the relevant information. You're free to use whatever parameters you'd like, but if you need some reference, here is an example with each placeholder filled in, as well as explanations of what each parameter does:

    id: FIRST_BIOME
        # The ID of your biome.
        # (This is similar to the pack ID in regards to naming conventions)
    
    vanilla: PLAINS
        # A vanilla biome ID - used for aspects like grass color, mob spawning, etc..
        # You can find a list of valid biome IDs on the minecraft wiki:
        # https://minecraft.fandom.com/wiki/Biome#Biome_IDs
    
    noise-equation: "-y + 64"
        # The mathematical equation that determines the shape of terrain.
        # How exactly this works is a more advanced topic we will cover later on.
        # For now, just know this equation will generate flat land at Y = 64.
    
    palette:
        # A list of blocks that the terrain in the biome will consist of.
        # In this case, Terra will generate stone everywhere there is land below Y = 255.
      - "BLOCK:minecraft:stone": 255

You should now have a configuration file located in the biomes folder like so pack directory/biomes/<biome_name>.yml, which as been filled out with the relevant information as specified above.


4. Finally, you will need to add your new biome to the pack manifest, so it can generate in the world.
  • Open your pack manifest in your editor.

  • Add the following lines to the config:

    biomes:
      type: SINGLE
      biome: <Biome ID>
  • Replace <Biome ID> with the ID you specified in the biome configuration in step 3. Here is an example of what that might look like:

    id: TUTORIAL
    author: Astrash # Optional
    version: 1.0.0  # Optional
    
    biomes:
      type: SINGLE
      biome: FIRST_BIOME

    You will also need to add the following lines in addition to the previous step so Terra will load the pack without errors:

    noise:
      temporary:       # This line
        type: CONSTANT # and this line
                       # will be removed later

    In the future, this extra part won't be needed in the step, as this won't be used in a minimal pack. For now, you don't need to worry about its purpose, however we will revisit this later down the line.

You should now have a pack manifest that looks similar to this:

id: TUTORIAL
author: Astrash

biomes:
  type: SINGLE
  biome: FIRST_BIOME

noise:
  temporary:
    type: CONSTANT

After creating the necessary files above, you should start your server / client and check your console(?) to see if your pack has loaded correctly. If everything loaded correctly, you should see this in your console:

[XX:XX:XX INFO]: [Terra] Loading config pack "<PACK NAME>"
[XX:XX:XX INFO]: [Terra] <PACK NAME> <PACK VERSION> by <AUTHOR> loaded in XXXX.XXXXms.

Onwards!

Once you have successfully set up your own Terra config pack, you may continue to the Configuring Your Pack page, where we will cover pack configuration.

⚠️ **GitHub.com Fallback** ⚠️