Entity Documentation - minecraft:behavior.random_swim

minecraft:behavior.random_swim compels an entity to swim in a random point in water.

Parameters

Name Default Value Type Description
avoid_surface true Boolean If true, the entity will avoid surface water blocks by swimming below them.
interval 120 Integer A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal.
priority not set Integer The higher the priority, the sooner this behavior will be executed as a goal.
speed_multiplier 1.0 Decimal Movement speed multiplier of the entity when using this AI Goal.
xz_dist 10 Integer Distance in blocks on ground that the entity will look for a new spot to move to. Must be at least 1.
y_dist 7 Integer Distance in blocks that the entity will look up or down for a new spot to move to. Must be at least 1.

Example

"minecraft:behavior.random_swim":{
    "priority": 8,
    "avoid_surface":true,
    "interval":42,
    "speed_multiplier": 1.0,
    "xy_dist": 10,
    "y_dist": 7
}

Vanilla entities examples

guardian

"minecraft:behavior.random_swim": {
        "priority": 7,
        "speed_multiplier": 1.0,
        "interval": 80,
        "avoid_surface": false
      }

Vanilla entities using minecraft:behavior.random_swim