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

minecraft:behavior.float

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

Overview

minecraft:behavior.float is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that keeps the mob bobbing at the surface while in water. Riders get off once the mob's head goes under, which tall mobs may never do.

Fields

FieldTypeDefaultDescription
sink_with_passengersbooleanfalseIf true, the mob keeps sinking while it carries riders.
chance_per_tick_to_floatnumber0.8Chance each tick to push the mob upward.
time_under_water_to_dismount_passengersnumber0Seconds the head can be under water before riders are thrown off.
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": {
    "sink_with_passengers": false,
    "chance_per_tick_to_float": 0.8,
    "time_under_water_to_dismount_passengers": 0,
    "priority": 0,
    "control_flags": []
  }
}

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