minecraft:behavior.swim_with_entity

Allows this entity to locate a random target block that it can path find to. Once found, the entity will move towards it and dig up an item. [Default target block types: Dirt, Grass, Podzol, DirtWithRoots, MossBlock, Mud, MuddyMangroveRoots].

Properties

PropertyTypeDefaultWhat it does
success_rateDecimal0.1Percent chance to start following another entity, if not already doing so. 1.0 = 100%
chance_to_stopDecimal0.0333Percent chance to stop following the current entity, if they're riding another entity or they're not swimming. 1.0 = 100%
state_check_intervalDecimalmin 00.5Time (in seconds) between checks to determine if this entity should catch up to the entity being followed or match the direction of the entity being followed.
catch_up_thresholdDecimal12Distance, from the entity being followed, at which this entity will speed up to reach that entity.
match_direction_thresholdDecimal2Distance, from the entity being followed, at which this entity will try to match that entity's direction
catch_up_multiplierDecimal2.5The multiplier this entity's speed is modified by when matching another entity's direction.
speed_multiplierDecimal1.5The multiplier this entity's speed is modified by when trying to catch up to the entity being followed.
search_rangeDecimal20Radius around this entity to search for another entity to follow.
stop_distanceDecimal5Distance, from the entity being followed, at which this entity will stop following that entity.
entity_typesList of object[]Filters which types of entities are valid to follow.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Conditions that make this entry in the list valid
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
max_distDecimal16Maximum distance this mob can be away to be a valid choice
max_heightDecimal-1Maximum height this mob can be away to be a valid choice
max_fleeDecimal10Maximum distance this mob can be from the target to stop fleeing
walk_speed_multiplierDecimal1Multiplier for the walking speed. A value of 1.0 means the speed is unchanged
sprint_speed_multiplierDecimal1Multiplier for the sprinting speed. A value of 1.0 means the speed is unchanged
priorityInteger0Priority for this mob type
check_if_outnumberedBooleanfalseIf true, the mob will check if its outnumbered
reevaluate_descriptionBooleanfalseIf true, the mob will stop being targeted if it stops meeting any conditions.
cooldownInteger0The amount of time in seconds that the mob has to wait before selecting a target of the same type again
must_seeBoolean—If true, the mob has to be visible to be a valid choice
must_see_forget_durationInteger3Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Dolphin uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.swim_with_entity": {
    "priority": 4,
    "success_rate": 0.1,
    "chance_to_stop": 0.0333,
    "state_check_interval": 0.5,
    "catch_up_threshold": 12.0,
    "match_direction_threshold": 2.0,
    "catch_up_multiplier": 2.5,
    "speed_multiplier": 1.5,
    "search_range": 20.0,
    "stop_distance": 5.0,
    "entity_types": [
      {
        "filters": {
          "test": "is_family",
          "subject": "other",
          "value": "player"
        }
      }
    ]
  }
}

Used by 1

Vanilla entities with minecraft:behavior.swim_with_entity in their definition:

Related components