Skip to content

Buildings

Townstead extends MCA building types with a separate file. Keep the MCA building definition in data/<namespace>/building_types/, then put Townstead-specific catalog, spirit, spawn, and enclosure data under extended_buildings.

Place extension files in:

data/<namespace>/extended_buildings/<building_type>.json

The path after extended_buildings/ is the MCA building type ID. For example:

data/example/extended_buildings/kitchen_l1.json

extends the MCA building type kitchen_l1.

Nested paths are allowed and become part of the building type ID:

data/example/extended_buildings/compat/farmersdelight/kitchen_l1.json

extends compat/farmersdelight/kitchen_l1.

{
"schema": "townstead:extended_building/v1",
"catalog": {
"node_item": "farmersdelight:cooking_pot"
},
"spirit": {
"pastoral": 12,
"commercial": 6
}
}

This adds a catalog icon and community-spirit values to the matching MCA building type without changing MCA’s own building JSON.

FieldRequiredDescription
schemaRecommendedIdentifies the file as a Townstead extended-building document.
catalogNoControls how the building appears in Townstead’s catalog.
spiritNoAdds community-spirit points when this building is present.
spawnNoRestricts which roots can spawn from this building.
enclosureNoMarks this building type as an open-air enclosure.
{
"catalog": {
"node_item": "minecraft:hay_block",
"hide": false
}
}
FieldDefaultDescription
node_itemItem ID used as the building’s catalog node icon.
hidefalseHides the building from the catalog when true.
{
"spirit": {
"pastoral": 6,
"commercial": 2
}
}

Spirit keys must be registered Townstead spirit IDs. Values must be positive integers; zero and negative values are ignored.

{
"spawn": {
"allowed_roots": ["townstead:human"],
"denied_roots": ["example:visitor"],
"check_village_dispositions": true
}
}
FieldDefaultDescription
allowed_roots[]Root IDs allowed to spawn from this building. Empty means any root is allowed unless denied.
denied_roots[]Root IDs that cannot spawn from this building. Deny rules win over allow rules.
check_village_dispositionstrueApplies the village-majority disposition filter when choosing a spawn.

Townstead currently uses building spawn policies for MCA inn spawns. The format is kept general so other building-driven spawns can use the same data later.

Older packs may use allowed_origins and denied_origins; Townstead still reads them as fallback aliases.

{
"enclosure": {
"minInterior": 4,
"maxInterior": 1024
}
}

Enclosures are open-air building types such as pens and docks. Townstead derives perimeter and interior requirements from the matching MCA building type’s blocks map:

  • Fences, fence gates, and walls become perimeter requirements.
  • Other blocks become interior signatures for classification.
FieldDefaultDescription
minInterior4Smallest interior area accepted for this enclosure.
maxInterior1024Largest interior area accepted for this enclosure.

The matching MCA building type still needs to define its block requirements in building_types.

Older packs may still use Townstead fields directly inside MCA building_types, companion files under data/<namespace>/spirit/, or spawn policies under data/<namespace>/building_spawn/. Townstead still reads those formats for compatibility, but extended_buildings is the preferred place for new building data and wins when both define the same value.