minecraft:behavior.rise_to_liquid_level for you with a switch.Get GodCraftOverview
minecraft:behavior.rise_to_liquid_level is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Keeps the mob floating at a set depth in a liquid, rising when too low and sinking when too high. Striders use it to stand on lava.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
liquid_y_offset | number | 0 | How far below the liquid surface the mob tries to stay. Bigger values sit it lower. |
rise_delta | number | 0 | How much the mob moves up each tick when it is under the target height. |
sink_delta | number | 0 | How much the mob moves down each tick when it is above the target height. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.rise_to_liquid_level": {
"liquid_y_offset": 0,
"rise_delta": 0,
"sink_delta": 0,
"priority": 0,
"control_flags": []
}
}