Skip to Content
DocsSystemsConfiguration

Overview

All animal behaviors are configurable through:

  • Mob profile files (per-entity configuration)
  • Archetype files (reusable behavior templates)
  • Template files (base configuration)

File Locations

TypePath
Mob profilesdata/better-ecology/mobs/<category>/<mob>.json
Archetypesdata/better-ecology/archetypes/<path>.yaml
Templatesdata/better-ecology/templates/<template>.yaml

Categories

  • passive/ - Non-hostile animals (sheep, cow, pig, chicken)
  • predator/ - Predatory animals (wolf, fox)
  • ambient/ - Ambient creatures (bat)

Profile Structure

Basic Profile

{ "identity": { "mob_id": "minecraft:sheep" }, "archetypes": [ "better-ecology:passive/grazer", "better-ecology:herd/diurnal" ], "hunger": { "enabled": true, "max": 100, "starting": 75, "decay_rate": 0.01 }, "behaviors": { "cohesion": 1.5, "separation": 1.8, "flee": 2.0 } }

Archetype Reference

Archetypes provide reusable behavior templates:

# archetypes/passive/grazer.yaml hunger: enabled: true max: 100 decay_rate: 0.01 grazing: enabled: true search_radius: 16.0 speed_modifier: 0.8

Common Configuration Sections

Hunger

{ "hunger": { "enabled": true, "max": 100, "starting": 75, "decay_rate": 0.01, "starvation_threshold": 10, "starvation_damage": 1 } }

Condition

{ "condition": { "enabled": true, "max": 100, "starting": 70 } }

Behaviors

{ "behaviors": { "cohesion": 1.5, "separation": 1.8, "alignment": 1.0, "flee": 2.0, "herd_cohesion": 1.6 } }

Flock Dynamics

{ "flock_dynamics": { "cohesion_radius": 16.0, "separation_distance": 2.0, "distress_radius": 20.0, "min_flock_size": 3 } }

Fleeing

{ "fleeing": { "enabled": true, "flight_initiation_distance": 16.0, "escape_strategy": "ZIGZAG", "zigzag_intensity": 0.5, "panic_threshold": 3 } }

Grazing

{ "grazing": { "enabled": true, "search_radius": 16.0, "speed_modifier": 0.8, "hunger_restoration": 25, "priority": 4 } }

Diet

{ "diet": { "food_sources": { "primary": [ {"type": "ITEM", "id": "minecraft:wheat"}, {"type": "TAG", "id": "#minecraft:flowers"} ] } } }

Player Interaction

{ "player_interaction": { "player_breeding": { "items": ["minecraft:wheat"], "cooldown": 6000 } } }

Hot-Reloading

Configuration changes take effect after running /reload:

  1. Modify JSON/YAML configuration files
  2. Run /reload command in-game
  3. New behaviors apply immediately
  4. Existing entities update gracefully

Merge Rules

When profiles include archetypes, values are merged:

ScenarioResult
null in profileArchetype value used
Empty list in profileArchetype value used
Non-empty list in profileProfile value replaces
Map in bothRecursive merge

Validation

Invalid configurations produce warnings:

  • Missing identity.mob_id skips the profile
  • Unknown handle IDs are logged
  • Type mismatches use defaults

Default Parameters

Behavior Weights

ParameterDefaultRange
cohesion1.00.0 - 3.0
separation1.50.0 - 3.0
alignment1.00.0 - 3.0
flee2.00.0 - 5.0

Distance Parameters

ParameterDefaultDescription
quorumThreshold0.3 - 0.7% of group needed to move
topologicalNeighbors6 - 7Neighbors for flocking
flightInitiationDistance8 - 32 blocksFlee trigger distance
givingUpDensity0.1 - 0.5Patch depletion threshold
territoryRadius16 - 64 blocksBreeding territory size
separationDistance1 - 5 blocksMinimum spacing
perceptionAngle270 degreesVisual field

Debugging

Inspect Entity Data

/data get entity @e[type=sheep,limit=1] better-ecology

Check Applied Weights

/data get entity @e[type=sheep,limit=1] better-ecology.behavior

Verify Profile Loading

Check server logs after /reload for profile parsing messages.

See Also

Last updated on