CustomStructures: generating structures in your world
CustomStructures spawns custom buildings in newly generated chunks of your Minecraft world. Create your own dungeons, villages and ruins from schematic files, and the plugin drops them into the terrain using conditions you configure.
What CustomStructures is
CustomStructures is a free plugin by ryandw11 that generates custom buildings in your Minecraft world. Just as vanilla generates villages, jungle temples and fortresses, CustomStructures lets you add your own structures that appear automatically in newly explored chunks.
The plugin uses schematic files (the WorldEdit/FAWE format) as its source. You build a structure in game, save it as a schematic and set the spawn conditions. That's it: the plugin places the structure in the terrain while chunks generate.
CustomStructures is available on SpigotMC and supports versions 1.13 to 1.21.x.
How generation works
The plugin hooks into Minecraft's chunk generation. Every time the server generates a new chunk (a player explores new terrain), CustomStructures checks the conditions and places a structure with the probability you set:
- The server generates a new chunk
- The plugin rolls whether a structure should appear in that chunk (based on the spawn chance)
- It checks the conditions: biome, height, surrounding blocks, distance from spawn
- If the conditions are met, it pastes the schematic at the right position
- Optionally, it fills chests with random loot from loot tables
Structures only generate in new chunks. Terrain that already exists won't change when you add a new structure, so you need to explore fresh areas.
Creating a structure
Here is the process, step by step:
- Build the structure in game (or download a ready-made schematic)
- Select it with WorldEdit tools (
//pos1,//pos2) - Save it as a schematic:
//schem save [name] - Copy the
.schemfile toplugins/CustomStructures/schematics/ - Create the structure's config file in
plugins/CustomStructures/structures/ - Reload the plugin:
/cstructure reload
Tip: when you select the structure, include air blocks wherever you want it to replace the terrain. Structure void blocks (Minecraft 1.10+) are ignored, which is handy when you want to keep the natural terrain around the structure.
Structure configuration
Each structure has a YAML file in plugins/CustomStructures/structures/:
# dungeon_ruin.yml
schematic: dungeon_ruin.schem
probability:
chance: 1
number: 500 # 1 in 500 chunks
spawn:
y: -1 # -1 = ground level
randomRotation: true
spawnInWater: false
spawnInLava: false
biomes:
- PLAINS
- FOREST
- DARK_FOREST
- TAIGA
worlds:
- world
distance:
minFromSpawn: 200 # minimum distance from spawn
minFromOther: 100 # minimum distance from another structure Key parameters:
- probability - spawn chance (chance/number = probability per chunk)
- biomes - the biomes where the structure can appear
- worlds - the worlds where the structure generates
- distance - minimum distances that keep structures from being packed too densely
- randomRotation - random rotation when pasting (0/90/180/270 degrees)
Loot tables and chests
CustomStructures supports random loot in chests placed inside structures. A loot table looks like this:
# In the structure file
lootTables:
default:
rolls: 3-6
items:
- material: IRON_INGOT
amount: 1-5
weight: 30
- material: GOLD_INGOT
amount: 1-3
weight: 15
- material: DIAMOND
amount: 1-2
weight: 5
- material: ENCHANTED_BOOK
amount: 1
weight: 10 Chests in the schematic fill automatically with random items from the loot table. The weight sets how likely an item is to be picked. Rolls is how many times the plugin picks an item: a range of 3-6 means 3 to 6 rolls.
You can also use vanilla Minecraft loot tables (for example minecraft:chests/simple_dungeon), which keeps the loot consistent with the rest of the game.
Tips and optimization
- Test before you deploy - use
/cstructure test [name]to paste the structure manually and check how it looks in the terrain - Don't overdo it - too many structures with a high probability slow down chunk generation. Start with low chances (1/500-1/1000)
- Use structure void - structure void blocks keep the natural terrain around the structure, which gives a more organic look
- Pregenerate the world - after adding structures, pregenerate the map with Chunky to spread the generation load over time
- Vary the loot - more distant or bigger structures should have better loot. It gives players a reason to explore
- Compatibility - CustomStructures works with terrain generators like Terra or Iris. Structures are pasted after the terrain is generated
Alternatives: StructureBoxes (simpler to configure), Advancius Structures (premium, more options) and Minecraft's built-in data packs, which can also add custom structures.