Skip to Content

Overview

AttributeValue
Health8 HP (4 hearts)
Movement Speed0.23
DietGrass blocks
Social TypeHerd animal
Maturity Time24000 ticks (20 minutes)

Behaviors

Wool Growth System

Implementation: me.javavirtualenv.ecology.handles.WoolHandle

Sheep grow wool over time based on nutrition and health. Wool quality affects shearing yield.

Growth Factors:

  • Requires hunger above 30% to grow wool
  • Growth progresses through stages 0-4
  • Quality determined by health, condition, and nutrition

Wool Quality Effects:

Quality RangeClassificationWool Drops
Above 0.8PremiumBase + 2
0.6 - 0.8GoodBase + 1
0.4 - 0.6NormalBase
Below 0.4PoorBase - 1 (minimum 1)

Configuration:

{ "wool": { "enabled": true, "max_wool_stage": 4, "min_wool_stage_for_shear": 3, "base_growth_chance": 0.15, "hunger_threshold": 30, "base_graze_chance": 0.35, "grazing_cooldown": 200, "hunger_restoration": 25, "base_wool_drops": 1 } }

Grazing Behavior

Implementation: me.javavirtualenv.ecology.ai.SheepGrazeGoal

Sheep actively seek and consume grass blocks to restore hunger.

Behavior Details:

  • Search radius: 16 blocks
  • Converts grass blocks to dirt
  • Restores 25 hunger points
  • Plays eating sounds and particles

Configuration:

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

Flock Dynamics

Implementation: me.javavirtualenv.behavior.sheep.SheepFlockCohesionBehavior

Sheep exhibit strong flock cohesion instincts, staying close to other sheep.

Behavior Details:

  • Cohesion radius: 16 blocks
  • Move toward flock when distance exceeds 6 blocks
  • Experience distress when isolated beyond 20 blocks

Configuration:

{ "behaviors": { "cohesion": 1.5, "herd_cohesion": 1.6, "separation": 1.8 }, "flock_dynamics": { "cohesion_radius": 16.0, "distress_radius": 20.0, "min_flock_size": 3 } }

Separation Distress

Implementation: me.javavirtualenv.behavior.sheep.SheepSeparationDistressBehavior

When separated from their flock, sheep exhibit distress behaviors.

Distress Levels:

Distance from FlockDistress LevelBehavior
0-6 blocks0.0-0.3Calm
6-12 blocks0.3-0.5Mildly concerned
12+ blocks0.5-1.0Distressed

Distress Behaviors:

  • Frequent bleating (interval reduces with distress)
  • Higher-pitched vocalizations
  • Increased movement speed to regroup
  • Worry particle effects

Lamb Care

Implementation: me.javavirtualenv.ecology.ai.EweProtectLambGoal

Adult ewes protect and care for lambs with maternal behaviors.

Behavior Details:

  • Protection radius: 24 blocks
  • Move toward lamb if distance exceeds 8 blocks
  • Detect when lamb is fleeing or hurt
  • Protective response when lamb is threatened

Lamb Danger Detection:

  • Lamb moving quickly (above 0.3 speed)
  • Lamb health below 70%
  • Ewe moves between threat and lamb

Configuration:

{ "lamb_care": { "enabled": true, "follow_range": 24.0, "protection_range": 12.0, "speed_modifier": 1.0, "priority": 2 } }

Sound Effects

Sheep use different vocalizations for communication:

ContextSoundNotes
EatingSHEEP_EATDuring grazing
ShearingSHEEP_SHEARWhen sheared
AmbientSHEEP_AMBIENTGeneral communication
Lamb careSHEEP_AMBIENTHigher pitch
DistressSHEEP_AMBIENTHigher pitch and volume

Integration

Component System

Sheep behaviors integrate with the ecology component system:

EcologyComponent component = sheep.getComponent(); CompoundTag woolTag = component.getHandleTag("wool"); int woolStage = woolTag.getInt("wool_stage"); float woolQuality = woolTag.getFloat("wool_quality");

Hunger System

Wool growth depends on hunger:

  • Requires hunger above 30% to grow
  • Growth chance scales with hunger level
  • Grazing restores 25 hunger points

Condition System

Wool quality calculation:

  • 30% from nutrition
  • 30% from condition
  • 20% from health percentage

Social System

Separation distress affects social needs:

  • Isolated sheep become lonely faster
  • Social recovery when grouped

NBT Data

Inspect sheep data using commands:

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

Expected output:

{ wool_stage: 3, last_shear_time: 12345, wool_quality: 0.75, last_graze_time: 12350, grazing_count: 15 }

Scientific Basis

Wool Growth

Based on real sheep wool growth cycles where growth rate depends on nutrition (protein intake) and quality is affected by overall health.

Flocking Behavior

Based on ungulate flocking research showing sheep are highly gregarious with strong separation anxiety when isolated.

Lamb Care

Based on maternal behavior research in sheep, including strong mother-young bonding, recognition by sound and smell, and protective behaviors.

See Also

Last updated on