minecraft:flocking
Allows entities to flock in groups in water or not.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
in_water | Boolean | false | Tells the Flocking Component if the entity exists in water. |
match_variants | Boolean | false | Tells the flockers that they can only match similar entities that also match the variant, mark variants, and color data of the other potential flockers. |
use_center_of_mass | Boolean | false | Tells the flockers that they will follow flocks based on the center of mass. |
low_flock_limit | Integer | 0 | Determines the low bound amount of entities that can be allowed in the flock. |
high_flock_limit | Integer | 0 | Determines the high bound amount of entities that can be allowed in the flock. |
goal_weight | Decimal | 0 | The weight on which to apply on the goal output. |
loner_chance | Decimal | 0 | The percentage chance between 0-1 that a fish will spawn and not want to join flocks. Invalid values will be capped at the end points. |
influence_radius | Decimal | 0 | The area around the entity that allows others to be added to the flock. |
breach_influence | Decimal | 0 | The amount of push back given to a flocker that breaches out of the water. |
separation_weight | Decimal | 1 | The weight applied to the separation of the flock. |
separation_threshold | Decimal | 2 | The distance that is determined to be to close to another flocking and to start applying separation. |
cohesion_weight | Decimal | 1 | The weight applied for the cohesion steering of the flock. |
cohesion_threshold | Decimal | 1 | The threshold in which to start applying cohesion. |
innner_cohesion_threshold | Decimal | 0 | The distance in which the flocker will stop applying cohesion. |
min_height | Decimal | 0 | The min height allowable in the air or water. |
max_height | Decimal | 0 | The max height allowable in the air or water. |
block_distance | Decimal | 0 | The amount of blocks away the entity will look at to push away from. |
block_weight | Decimal | 0 | The weight of the push back away from blocks. |
Example from the game files
This is how vanilla Dolphin uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:flocking": {
"in_water": false,
"match_variants": false,
"use_center_of_mass": false,
"low_flock_limit": 4,
"high_flock_limit": 8,
"goal_weight": 2.0,
"loner_chance": 0.1,
"influence_radius": 6.0,
"breach_influence": 0.0,
"separation_weight": 1.75,
"separation_threshold": 3.0,
"cohesion_weight": 1.85,
"cohesion_threshold": 6.5,
"innner_cohesion_threshold": 3.5,
"min_height": 4.0,
"max_height": 4.0,
"block_distance": 1.0,
"block_weight": 0.0
}
}Used by 5
Vanilla entities with minecraft:flocking in their definition: