Configuration¶
Better Ecology uses data-driven configuration files that can be hot-reloaded without restarting the game.
Overview¶
All animal behaviors are configurable through:
- Mob profile files: Per-entity configuration
- Archetype files: Reusable behavior templates
- Template files: Base configuration defaults
File Locations¶
| Type | Path |
|---|---|
| Mob profiles | data/better-ecology/mobs/<category>/<mob>.json |
| Archetypes | data/better-ecology/archetypes/<path>.yaml |
| Templates | data/better-ecology/templates/<template>.yaml |
Categories¶
passive/- Non-hostile animals (sheep, cow, pig, chicken)predator/- Predatory animals (wolf, fox)ambient/- Ambient creatures (bat)
Hot-Reloading¶
Configuration changes take effect after running /reload:
- Modify configuration files
- Run
/reloadcommand in-game - New behaviors apply immediately
- Existing entities update gracefully
Basic Configuration¶
Hunger System¶
{
"hunger": {
"enabled": true,
"max": 100,
"starting": 75,
"decay_rate": 0.01,
"starvation_threshold": 10,
"starvation_damage": 1
}
}
Behavior Weights¶
Fleeing Configuration¶
{
"fleeing": {
"enabled": true,
"flight_initiation_distance": 16.0,
"escape_strategy": "ZIGZAG",
"zigzag_intensity": 0.5
}
}
Using Archetypes¶
Archetypes provide reusable behavior templates:
Values from archetypes are merged with the mob profile, with profile values taking precedence.
Common Parameters¶
Distance Parameters¶
| Parameter | Default Range | Description |
|---|---|---|
quorumThreshold | 0.3 - 0.7 | Percentage of group needed to move |
topologicalNeighbors | 6 - 7 | Neighbors tracked for flocking |
flightInitiationDistance | 8 - 32 blocks | Distance to trigger fleeing |
separationDistance | 1 - 5 blocks | Minimum spacing between animals |
Behavior Weights¶
| Parameter | Default | Description |
|---|---|---|
cohesion | 1.0 | Strength of group cohesion |
separation | 1.5 | Strength of spacing maintenance |
alignment | 1.0 | Strength of heading alignment |
flee | 2.0 | Strength of escape behavior |
Debugging¶
Inspect Entity Data¶
Check Applied Weights¶
Advanced Configuration¶
For detailed configuration options, see the Configuration System documentation.