structures - mickelus/tetra GitHub Wiki

Structures

Work in progress

Tetra adds a few structures to world generation, structures can be changed or new ones can be added using datapacks. Json files placed within tetra/structures define how structures are generated.

A structure may contain a list of child structures, all structures in vanilla tetra are made up of a heirarchy of structures.

Each structure json file has to be accompanied by a .nbt file containing the actual structure, you can create structure .nbt files using the vanilla structure block.

Turning on the development mode config option will show an in world overlay for all structure blocks that have names that match a structure json.

Example json

Example json:

{
    "biomes": ["cold", "snowy"],
    "origin": [3, 0, 3],
    "probability": 0.05,
    "minY": 7,
    "maxY": 22,
    "integrityMin": 0.95,
    "children": [
        {
            "offset": [3, 1, 3],
            "facing": "WEST",
            "features": ["tetra:forged_hammer", "tetra:collapse_gravel"]
        },
        {
            "offset": [3, 2, 0],
            "features": ["tetra:forged_hallway_1", "tetra:forged_collapse_1"]
        }
    ],
    "loot": [
        {
            "position": [0, 0, 0],
            "table": "tetra:forged/chest_large"
        }
    ]
}

Structure format

biome optional

A list of biome categories that this structure can generate in. Biomes have a category and if that category matches any of the categories in this list then the feature is allowed to generate in the biome. The following values are available: none, taiga, extreme_hills, jungle, mesa, plains, savanna, icy, the_end, beach, forest, ocean, desert, river, swamp, mushroom, nether

Allows the stucture to generate in the world if set, otherwise the structure can only generate as a child of another structure

Example value: ["hot", "water", "rare"]

dimensions optional

A list of resource locations denoting the dimensions that this structure can generate in, not relevant for child structures.

The vanilla dimensions are: minecraft:overworld, minecraft:the_nether, minecraft:the_end

Defaults to the overworld if not provided

Example value: ["minecraft:overworld", "minecraft:the_end"]

probability optional

The probability that this structure will generate in applicable chunks. Should be between 0 and 1, where a value of 1 would cause it to generate in every chunk, 0.5 would cause it to generate in 50% of the chunks and a value of 0 would cause it to never generate. Not relevant for child structures.

minY optional

The minimum Y level that this structure is allowed to generate at, not relevant for child structures.

Default value: 4

maxY optional

The maximum Y level that this structure is allowed to generate at, not relevant for child structures.

Default value: 4

integrityMin optional

Min value for structure integrity, a random value between min and max will be used on generation. Must be between 0.0 and 1.0, and min should not be larger than max. Does not propagate to children. Default value: 1

integrityMax optional

Max values for structure integrity, a random value between min and max will be used on generation. Must be between 0.0 and 1.0, and min should not be larger than max. Does not propagate to children. Default value: 1

origin optional

The origin of this structure. Structures are rotated around their origin, also used when positioning child structures relative to their parent.

Json format: [x, y, z]
Default value: [0, 0, 0]

transform optional

Indicates if this structure can be rotated or mirrored when placed. Should be set to false when a structure has to align with cardinal directions, or when using blocks from other mods which do not support rotation or mirroring.

Default value: true

transform optional

Used to specify which structures can generated as a part of this structure, and how/where to do so.

offset optional

The position offset relative to the parent at which this child feature should be generated.

Json format: [x, y, z] Default value: [0, 0, 0]

facing optional

The direction in which the child feature should be facing. A bit tricky to explain, look at the ingame overlay.

Possible values: "DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"

Default value: NORTH

chance optional

The chance for this child feature to generate. Has to be a decimal number between 0.0 and 1.1, where a value of 1.0 would cause it to always generate.

Default value: 1

features

An array of resource locations for features that can be used as child features at this position.

loot optional

Used to specify where and which loot can be generated within this structure.

position

The position where loot should be generated, this is relative to the feature and there should be tile entity implementing IInventory at the position. Json format: [x, y, z]

table

A resource location referring to a loot table.