Skip to main content
Template pools are collections of structure pieces that can be randomly selected during structure generation. Lithostitched extends vanilla template pools with powerful new pool element types.

DelegatingPoolElement

The DelegatingPoolElement wraps any vanilla pool element and adds advanced features like depth restrictions, placement limits, and custom conditions.

Configuration Fields

type
string
required
Must be "lithostitched:delegating"
delegate
StructurePoolElement
required
The underlying pool element that handles actual structure placement. Can be any vanilla pool element type (single, list, feature, legacy, empty).
name
identifier
Optional identifier for this pool element. Used for tracking and debugging. If not provided, a generated name is used.
allowed_depth
IntRange
Restricts this element to specific depth levels in the structure generation tree. Uses an inclusive range format.
"allowed_depth": [0, 3]
This example only allows placement at depths 0-3 (inclusive).
forced_count
integer
Number of instances to force placement before other pieces are considered. These pieces are prioritized in the shuffling algorithm.
Mutually exclusive with max_count
max_count
integer
Maximum number of instances of this element that can be placed in a single structure.
Mutually exclusive with forced_count
condition
PlacementCondition
Custom placement condition that must be satisfied for this element to spawn. See Placement Conditions for available types.
allow_bounding_box_collisions
boolean
default:"false"
If true, allows this piece’s bounding box to collide with other pieces.
other_pieces_can_intersect
boolean
default:"false"
If true, allows other pieces to intersect with this piece.
override_terrain_adaption
TerrainAdjustment
Overrides the structure’s terrain adjustment setting for this specific piece. Valid values:
  • "none"
  • "bury"
  • "beard_thin"
  • "beard_box"
  • "encapsulate"

Example: Limited Depth

Restrict a special room to only appear in the first 2 levels of a structure:
{
  "type": "lithostitched:delegating",
  "delegate": {
    "element_type": "minecraft:single_pool_element",
    "location": "mymod:dungeon/treasure_room",
    "processors": "minecraft:empty",
    "projection": "rigid"
  },
  "allowed_depth": [0, 1],
  "max_count": 1
}

Example: Forced Placement

Guarantee a specific piece appears multiple times:
{
  "type": "lithostitched:delegating",
  "delegate": {
    "element_type": "minecraft:single_pool_element",
    "location": "mymod:village/fountain",
    "processors": "minecraft:empty",
    "projection": "terrain_matching"
  },
  "forced_count": 2,
  "name": "mymod:village_fountain"
}

Example: Conditional Placement

Only place a piece if specific biome conditions are met:
{
  "type": "lithostitched:delegating",
  "delegate": {
    "element_type": "minecraft:single_pool_element",
    "location": "mymod:outpost/watchtower",
    "processors": "minecraft:empty",
    "projection": "rigid"
  },
  "condition": {
    "type": "lithostitched:in_biome",
    "biomes": "#minecraft:is_mountain"
  },
  "max_count": 3
}

Template Pool Structure

Lithostitched-enhanced template pools follow the vanilla structure with additional element types:
{
  "fallback": "minecraft:empty",
  "elements": [
    {
      "weight": 5,
      "element": {
        "type": "lithostitched:delegating",
        "delegate": {
          "element_type": "minecraft:single_pool_element",
          "location": "mymod:structure/common_room",
          "processors": "mymod:dungeon_processors",
          "projection": "rigid"
        }
      }
    },
    {
      "weight": 1,
      "element": {
        "type": "lithostitched:delegating",
        "delegate": {
          "element_type": "minecraft:single_pool_element",
          "location": "mymod:structure/rare_room",
          "processors": "mymod:dungeon_processors",
          "projection": "rigid"
        },
        "max_count": 1
      }
    }
  ]
}

Template Shuffling

Lithostitched uses a custom weighted shuffling algorithm (LithostitchedTemplates) that:
  1. Assigns a random weight to each element based on its configured weight
  2. Prioritizes elements with forced_count set (given a -2 weight offset)
  3. Sorts by calculated random weight: -pow(random, 1/weight) + (prioritized ? -2 : 0)
This ensures:
  • Higher weights are more likely to appear earlier in the shuffled list
  • Forced elements appear before all other elements
  • Randomization while maintaining weight distribution
The shuffling algorithm is defined in LithostitchedTemplates at /home/daytona/workspace/source/src/common/main/java/dev/worldgen/lithostitched/worldgen/structure/LithostitchedTemplates.java:68

Best Practices

Restrict rare or special rooms to specific depths to create more interesting dungeon layouts:
"allowed_depth": [3, 5]  // Only appears deep in the structure
Prevent overwhelming the structure with special rooms:
"max_count": 1  // Only one boss room per structure
Use multiple conditions to create highly specific placement rules:
"condition": {
  "type": "lithostitched:all_of",
  "conditions": [
    { "type": "lithostitched:height_filter", "min_inclusive": 60 },
    { "type": "lithostitched:in_biome", "biomes": "#minecraft:is_ocean" }
  ]
}

Pool Elements

Learn about other pool element types

Processors

Transform blocks during placement

Placement Conditions

Control when elements spawn

Pool Aliases

Dynamic pool substitution

Build docs developers (and LLMs) love