Skip to content

Prefab Structures

Prefabs are pre-built block structures used for world generation and spawning. They range from simple trees to complex dungeon rooms, monuments, and NPC camps.

  • DirectoryAssets/Server/Prefabs/
    • DirectoryCave/
      • DirectoryFormations/
      • DirectoryGeysers/
      • DirectoryKlops/
    • DirectoryDungeon/
      • DirectoryChallenge_Gate/
      • DirectoryCursed_Crypt/
      • DirectoryGoblin_Lair/
      • DirectoryLabyrinth/
      • DirectoryMagic_Ruins/
      • DirectoryOutlander_Temple/
      • DirectoryRift/
      • DirectorySandstone/
      • DirectorySewer/
      • DirectoryShale/
      • DirectorySlate/
      • DirectoryStone/
    • DirectoryMineshaft/
    • DirectoryMineshaft_Drift/
    • DirectoryMonuments/
      • DirectoryChallenge/
      • DirectoryEncounter/
      • DirectoryIncidental/
      • DirectoryStory/
      • DirectoryUnique/
    • DirectoryNpc/
    • DirectoryPlants/
    • DirectoryRock_Formations/
    • DirectorySpawn/
    • DirectoryTesting/
    • DirectoryTrees/
      • DirectoryOak/
      • DirectoryBirch/
      • DirectoryAsh/
      • DirectoryPine/
      • (70+ tree types)
    • Example_Portal1.prefab.json
    • default.minigame.prefab.json
FieldTypeDescription
versionintPrefab format version
blockIdVersionintBlock ID mapping version
anchorXintX anchor point
anchorYintY anchor point
anchorZintZ anchor point
blocksarrayBlock placement data
FieldTypeDescription
xintX offset from anchor
yintY offset from anchor
zintZ offset from anchor
namestringBlock type ID
rotationintOptional rotation (0-3)

Prefabs use .prefab.json extension with optional .prefab.json.lpf compressed variant:

Example_Portal1.prefab.json
{
"version": 8,
"blockIdVersion": 1,
"anchorX": 0,
"anchorY": 0,
"anchorZ": 0,
"blocks": [
{
"x": -1,
"y": 0,
"z": -2,
"name": "Rock_Aqua_Brick"
},
{
"x": -1,
"y": 1,
"z": -2,
"name": "Rock_Aqua_Brick"
},
{
"x": 1,
"y": 0,
"z": -1,
"name": "Rock_Aqua_Brick_Stairs",
"rotation": 1
}
]
}

Located in Trees/, organized by species and growth stage:

  • DirectoryTrees/
    • DirectoryOak/
      • DirectoryStage_0/
        • Oak_Stage0_001.prefab.json
        • Oak_Stage0_002.prefab.json
      • DirectoryStage_1/
      • DirectoryStage_2/
      • DirectoryStage_3/
      • DirectoryStage_4/
      • DirectoryStage_5/
      • DirectoryStage_6/
      • DirectoryStage_7/
      • DirectoryStumps/
    • DirectoryBirch/
    • DirectoryPine/

Stage System:

StageDescription
Stage_0 / Stage_00Sapling/small
Stage_1 - Stage_3Growing sizes
Stage_4 - Stage_5Medium trees
Stage_6 - Stage_7Large/giant trees
StumpsCut tree remains

Tree Types (70+ species):

  • Temperate: Oak, Birch, Beech, Ash, Aspen
  • Autumn: Autumn, Amber
  • Magical: Azure, Hedera
  • Tropical: Banyan, Bamboo, Palm
  • Cold: Pine, Spruce, Fir, Boreal
  • Dead: Ash_Dead, Beech_Dry

Located in Cave/:

DirectoryContents
Formations/Rock_Stone/Stone stalactites/stalagmites
Formations/Rock_Sandstone/Sandstone formations
Formations/Rock_Volcanic/Volcanic rock formations
Geysers/Geyser prefabs
Klops/Klops (troll) cave dwellings

Klops Cave Structure:

  • DirectoryKlops/Basalt/
    • DirectoryStart/ Entry room
    • DirectoryMain/ Main living area
    • DirectoryMain_2/ Secondary room
    • DirectoryMain_3/ Tertiary room
    • DirectoryBedroom/ Sleeping area
    • DirectoryBathroom/ Utility room
    • DirectoryCellar/ Storage
    • DirectoryCave/ Natural cave section
    • DirectoryStairs_Up/ Upper connection
    • DirectoryStairs_Down/ Lower connection
    • DirectoryEntrance/ Cave entrance

Located in Dungeon/, organized by dungeon type:

DungeonDescription
Challenge_Gate/Challenge room structures
Cursed_Crypt/Undead dungeon areas
Goblin_Lair/Goblin cave rooms
Labyrinth/Maze-like structures
Magic_Ruins/Ancient magical ruins
Outlander_Temple/Outlander faction temple
Rift/Dimensional rift areas
Sewer/Underground sewer system
Stone/Generic stone dungeon
Shale/Shale rock dungeon
Slate/Slate rock dungeon
Sandstone/Desert dungeon

Located in Monuments/:

CategoryDescription
Challenge/Combat challenge arenas
Encounter/NPC encounter locations
Incidental/Small points of interest
Story/Story-related structures
Unique/One-of-a-kind locations

Located in Npc/:

  • Camp structures
  • Faction buildings
  • NPC spawn points

Located in Plants/:

  • Bushes and shrubs
  • Flowers and grass
  • Crops and farming plants

Located in Rock_Formations/:

  • Natural rock outcrops
  • Boulder clusters
  • Cliff faces
DirectoryDescription
Mineshaft/Standard mine tunnels
Mineshaft_Drift/Drift mine structures
Oak_Stage0_001.prefab.json
{
"version": 8,
"blockIdVersion": 3,
"anchorX": 0,
"anchorY": 0,
"anchorZ": 0,
"blocks": [
{ "x": 0, "y": 0, "z": 0, "name": "Plant_Trunk_Oak" },
{ "x": 0, "y": 1, "z": 0, "name": "Plant_Trunk_Oak" },
{ "x": 0, "y": 2, "z": 0, "name": "Plant_Trunk_Oak" },
{ "x": 0, "y": 3, "z": 0, "name": "Plant_Leaves_Oak" },
{ "x": -1, "y": 3, "z": 0, "name": "Plant_Leaves_Oak" },
{ "x": 1, "y": 3, "z": 0, "name": "Plant_Leaves_Oak" },
{ "x": 0, "y": 3, "z": -1, "name": "Plant_Leaves_Oak" },
{ "x": 0, "y": 3, "z": 1, "name": "Plant_Leaves_Oak" },
{ "x": 0, "y": 4, "z": 0, "name": "Plant_Leaves_Oak" }
]
}
default.minigame.prefab.json
{
"version": 8,
"blockIdVersion": 0,
"anchorX": 0,
"anchorY": 0,
"anchorZ": 0,
"blocks": [
{
"x": -1,
"y": 0,
"z": 0,
"name": "Furniture_Village_Window",
"rotation": 1
},
{
"x": -1,
"y": 1,
"z": 0,
"name": "Furniture_Village_Window",
"rotation": 1
},
{
"x": 0,
"y": 0,
"z": -1,
"name": "Furniture_Village_Window"
},
{
"x": 0,
"y": -1,
"z": 0,
"name": "Rock_Gold_Brick"
},
{
"x": 0,
"y": 2,
"z": 0,
"name": "Deco_Lantern"
}
]
}
Dungeon_Empty.prefab.json
{
"version": 8,
"blockIdVersion": 8,
"anchorX": 0,
"anchorY": 0,
"anchorZ": 0,
"blocks": [
{ "x": 0, "y": 0, "z": 0, "name": "Empty" },
{ "x": 0, "y": 1, "z": 0, "name": "Empty" }
]
}

The Empty block type clears existing blocks at that position.

ValueDirection
0North (default)
1East (90°)
2South (180°)
3West (270°)

The anchor point (anchorX, anchorY, anchorZ) defines where the prefab is placed relative to its spawn position:

  • X/Z = 0: Prefab centered on placement point
  • Y = 0: Bottom of prefab at placement height

Block coordinates are relative to this anchor.

Large prefabs have accompanying .prefab.json.lpf files containing compressed binary data for faster loading.

MyPlugin_Structure.prefab.json
{
"version": 8,
"blockIdVersion": 1,
"anchorX": 0,
"anchorY": 0,
"anchorZ": 0,
"blocks": [
{ "x": 0, "y": 0, "z": 0, "name": "Rock_Stone_Brick" },
{ "x": 1, "y": 0, "z": 0, "name": "Rock_Stone_Brick" },
{ "x": 0, "y": 0, "z": 1, "name": "Rock_Stone_Brick" },
{ "x": 1, "y": 0, "z": 1, "name": "Rock_Stone_Brick" },
{ "x": 0, "y": 1, "z": 0, "name": "Rock_Stone_Brick" },
{ "x": 1, "y": 1, "z": 0, "name": "Rock_Stone_Brick" },
{ "x": 0, "y": 1, "z": 1, "name": "Rock_Stone_Brick" },
{ "x": 1, "y": 1, "z": 1, "name": "Rock_Stone_Brick" },
{ "x": 0, "y": 2, "z": 0, "name": "Rock_Stone_Brick_Stairs" },
{ "x": 1, "y": 2, "z": 0, "name": "Rock_Stone_Brick_Stairs", "rotation": 2 },
{ "x": 0, "y": 2, "z": 1, "name": "Rock_Stone_Brick_Stairs", "rotation": 1 },
{ "x": 1, "y": 2, "z": 1, "name": "Rock_Stone_Brick_Stairs", "rotation": 3 }
]
}

Prefabs use standard block type IDs:

CategoryPatternExamples
RockRock_[Material]_[Variant]Rock_Stone_Brick, Rock_Aqua_Brick_Ornate
WoodWood_[Type]_[Variant]Wood_Oak_Planks
PlantsPlant_[Type]_[Species]Plant_Leaves_Oak, Plant_Trunk_Birch
FurnitureFurniture_[Set]_[Item]Furniture_Village_Window
DecorationDeco_[Type]Deco_Lantern
EmptyEmptyClears block
  1. Use meaningful anchor points - Center on logical placement position
  2. Include rotation for directional blocks - Doors, stairs, etc.
  3. Keep coordinates reasonable - Large prefabs impact performance
  4. Use Empty strategically - Clear unwanted terrain
  5. Version your prefabs - Use current version number (8)
  6. Match blockIdVersion - Ensure block IDs are valid for version

Prefabs are placed during world generation based on:

  • Biome rules
  • Terrain conditions
  • Random distribution
  • Dungeon node graphs