Overview
Pheno is Townstead’s shared behaviour language, a bit like the cause and effect engine. It describes conditions, actions, selectors, values, capabilities, and runtime context that other Townstead systems can embed.
What Pheno Provides
Section titled “What Pheno Provides”| Area | Purpose |
|---|---|
| Conditions | Decide whether something is true in the current context. |
| Actions | Do something in the world, to an entity, to an item, or at a block position. |
| Selectors | Choose entities or blocks for actions and conditions. |
| Values | Provide numbers from runtime context. |
| Gene Nodes | Pheno-backed gene nodes used inside Roots gene files. |
| Structure | How typed nodes, domains, context, wrappers, authoring rules, and validation fit together. |
| Context | How Pheno decides the current actor, target, origin, block, item, holder, or cause. |
| Diagnostics | Report unknown types, malformed fields, and generated reference data for pack authors. |
Start with the examples page if you want to see conditions, actions, selectors, and values working together before reading the reference tables.
Where It Appears
Section titled “Where It Appears”Pheno is embedded inside other data formats. The outer file owns the schema field and selects the authoring rules for its nested Pheno blocks.
For example, a gene can use a Pheno action:
{ "schema": "townstead:gene/v2", "type": "pheno:active_ability", "cooldown": "10s", "do": { "type": "pheno:heal", "amount": 4 }}A reaction can use a Pheno condition:
{ "schema": "townstead:reaction/v2", "when": { "type": "pheno:environment", "weather": "clear" }}Nested Pheno objects do not declare their own schema.