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
| Property | Type | Default | What it does |
|---|---|---|---|
success_rate | Decimal | 0.1 | Percent chance to start following another entity, if not already doing so. 1.0 = 100% |
chance_to_stop | Decimal | 0.0333 | Percent chance to stop following the current entity, if they're riding another entity or they're not swimming. 1.0 = 100% |
state_check_interval | Decimalmin 0 | 0.5 | Time (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_threshold | Decimal | 12 | Distance, from the entity being followed, at which this entity will speed up to reach that entity. |
match_direction_threshold | Decimal | 2 | Distance, from the entity being followed, at which this entity will try to match that entity's direction |
catch_up_multiplier | Decimal | 2.5 | The multiplier this entity's speed is modified by when matching another entity's direction. |
speed_multiplier | Decimal | 1.5 | The multiplier this entity's speed is modified by when trying to catch up to the entity being followed. |
search_range | Decimal | 20 | Radius around this entity to search for another entity to follow. |
stop_distance | Decimal | 5 | Distance, from the entity being followed, at which this entity will stop following that entity. |
entity_types | List of object | [] | Filters which types of entities are valid to follow. |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that make this entry in the list valid |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
max_dist | Decimal | 16 | Maximum distance this mob can be away to be a valid choice |
max_height | Decimal | -1 | Maximum height this mob can be away to be a valid choice |
max_flee | Decimal | 10 | Maximum distance this mob can be from the target to stop fleeing |
walk_speed_multiplier | Decimal | 1 | Multiplier for the walking speed. A value of 1.0 means the speed is unchanged |
sprint_speed_multiplier | Decimal | 1 | Multiplier for the sprinting speed. A value of 1.0 means the speed is unchanged |
priority | Integer | 0 | Priority for this mob type |
check_if_outnumbered | Boolean | false | If true, the mob will check if its outnumbered |
reevaluate_description | Boolean | false | If true, the mob will stop being targeted if it stops meeting any conditions. |
cooldown | Integer | 0 | The amount of time in seconds that the mob has to wait before selecting a target of the same type again |
must_see | Boolean | — | If true, the mob has to be visible to be a valid choice |
must_see_forget_duration | Integer | 3 | Determines 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 |
priority | Integermin 0 | 0 | |
control_flags | List 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
behavior.look_at_playerbehavior.temptbehavior.breedbehavior.mount_pathingbehavior.follow_parentbehavior.player_ride_tamedbehavior.find_mountbehavior.celebratebehavior.follow_ownerbehavior.stay_while_sittingbehavior.look_at_trading_playerbehavior.random_look_around_and_sitbehavior.take_flowerbehavior.trade_with_playerbehavior.celebrate_survivebehavior.controlled_by_playerbehavior.follow_caravanbehavior.follow_mobbehavior.make_lovebehavior.ocelot_sit_on_blockbehavior.playbehavior.receive_lovebehavior.share_itemsbehavior.trade_interest