1. Wiki
  2. /Entities
  3. /minecraft:flocking

minecraft:flocking

Don't want to write this by hand? GodCraft sets minecraft:flocking for you with a switch.Get GodCraft

Overview

minecraft:flocking is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the entity move in a group with others of its kind, like a school of fish. Lots of weights let you tune how tightly the group sticks together.

Fields

FieldTypeDefaultDescription
in_waterbooleanfalseSet to true if the flock lives in water.
match_variantsbooleanfalseOnly flock with entities that have the same variant, mark variant and color.
use_center_of_massbooleanfalseSteer toward the middle of the flock.
low_flock_limitinteger0Smallest number of entities a flock should have.
high_flock_limitinteger0Largest number of entities allowed in a flock.
goal_weightnumber0How strongly the flocking result affects movement.
loner_chancenumber0Chance from 0 to 1 that the entity spawns as a loner that never joins a flock.
influence_radiusnumber0Distance within which other entities can join this one's flock.
breach_influencenumber0How hard a flock member is pushed back when it jumps out of the water.
separation_weightnumber1How strongly members keep space between each other.
separation_thresholdnumber2Distance at which members start moving apart because they are too close.
cohesion_weightnumber1How strongly members steer toward each other.
cohesion_thresholdnumber1Distance at which members start pulling together.
innner_cohesion_thresholdnumber0Distance at which members stop pulling closer.
min_heightnumber0Lowest height the flock may move at.
max_heightnumber0Highest height the flock may move at.
block_distancenumber0How many blocks ahead the entity checks for blocks to steer away from.
block_weightnumber0How strongly the entity steers away from blocks.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:flocking": {
    "in_water": false,
    "match_variants": false,
    "use_center_of_mass": false,
    "low_flock_limit": 0,
    "high_flock_limit": 0,
    "goal_weight": 0,
    "loner_chance": 0,
    "influence_radius": 0
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more