Skip to content

Traits

Trait files register Townstead traits into MCA’s trait system. Trait occurrence genes can grant or bias them at spawn.

Path: data/<namespace>/trait/<path>.json

Schema: townstead:trait/v1

{
"schema": "townstead:trait/v1",
"chance": 0,
"inherit": 1,
"usable_on_player": true,
"hidden": false,
"effects": [
{ "life.immortal": true }
]
}
FieldTypeRequiredNotes
schemastringyestownstead:trait/v1.
chancenumbernoMCA trait chance. Defaults to 0.
inheritnumbernoMCA inheritance weight. Defaults to 1.
usable_on_playerbooleannoDefaults to true.
hiddenbooleannoDefaults to false.
effectsarraynoEffect entries.

The currently documented effect surface is intentionally small.

EffectValueBehaviour
life.immortalbooleanMarks the trait as immortal when true.

Gene type: townstead_roots:trait_occurrence

Trait occurrence genes roll at spawn. They are not stored as normal diploid alleles.

{
"schema": "townstead:gene/v2",
"type": "townstead_roots:trait_occurrence",
"trait": "my_pack:immortal",
"delta": 0.25
}
FieldTypeRequiredNotes
traitidyesTrait id to grant or bias.
deltanumbernoSpawn chance adjustment. Defaults to 0.
forcebooleannoIf true, the trait chance is treated as 1.

For mixed founders, trait occurrence chances are fraction-weighted across the selected roots.