1. Wiki
  2. /Entities
  3. /minecraft:behavior.float_wander

minecraft:behavior.float_wander

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

Overview

minecraft:behavior.float_wander is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob drift around in the air to random spots, like a ghast.

Fields

FieldTypeDefaultDescription
xz_distinteger10How far sideways the next spot can be. Must be 1 or more.
y_distinteger7How far up or down the next spot can be. Must be 1 or more.
y_offsetnumber0Blocks added to the height of the chosen spot.
must_reachbooleanfalseIf true, the spot must be reachable to be picked.
random_reselectbooleanfalseIf true, the mob may switch to a new spot before reaching the current one.
use_home_position_restrictionbooleantrueIf true, spots are kept inside the mob's home area.
float_durationFloatRange{"max":0,"min":0}Random range in seconds the mob drifts before doing something else.
float_wander_has_move_controlbooleantrueIf true, this goal claims movement, so it cannot run with other goals that move the mob.
surface_xz_distinteger8How far sideways to check for a surface near a spot. Only used with navigate_around_surface.
surface_y_distinteger8How far up and down to check for a surface near a spot. Only used with navigate_around_surface.
additional_collision_bufferbooleanfalseIf true, extra space is kept around the mob so it does not bump into blocks.
navigate_around_surfacebooleanfalseIf true, the mob prefers spots close to solid blocks instead of open air or liquid.
allow_navigating_through_liquidsbooleanfalseIf true, the mob may pass through liquids on the way.
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together.

Example

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

BP/entities/<name>.json
{
  "minecraft:behavior.float_wander": {
    "xz_dist": 10,
    "y_dist": 7,
    "y_offset": 0,
    "must_reach": false,
    "random_reselect": false,
    "use_home_position_restriction": true,
    "float_duration": {
      "max": 0,
      "min": 0
    },
    "float_wander_has_move_control": true
  }
}

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