minecraft:behavior.float
Allows the mob to stay afloat while swimming. Passengers will be kicked out the moment the mob's head goes underwater, which may not happen for tall mobs.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
sink_with_passengers | Boolean | false | If true, the mob will keep sinking as long as it has passengers. |
chance_per_tick_to_float | Decimal | 0.8 | The chance per tick to cause an upward impulse. |
time_under_water_to_dismount_passengers | Decimal | 0 | Time in seconds that a floating vehicles head can be underwater before it causes its passengers to dismount. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Camel uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.float": {
"priority": 0,
"chance_per_tick_to_float": 1.0,
"time_under_water_to_dismount_passengers": 2.0
}
}Used by 49
Vanilla entities with minecraft:behavior.float in their definition:
AllayArmadilloBatBeeBlazeBreezeCamelCamel HuskCatCave SpiderChickenCowCreakingCreeperDonkeyEndermanEndermiteEvokerFoxGhastGoatHappy GhastHorseLlamaMooshroomMuleOcelotPandaParrotPigPillagerPolar BearRabbitRavagerSheepSilverfishSnifferSpiderTrader LlamaVexVillagerVillagerVindicatorWandering TraderWardenWitchWitherWolfZombie Horse
Related components
behavior.random_swimbehavior.swim_idlebehavior.swim_wanderbehavior.use_kinetic_weaponbehavior.move_to_waterbehavior.teleport_to_ownerbehavior.float_wanderbehavior.go_homebehavior.random_hoverbehavior.slime_floatbehavior.slime_keep_on_jumpingbehavior.slime_random_directionbehavior.move_to_landbehavior.move_to_random_blockbehavior.circle_around_anchorbehavior.dragonholdingpatternbehavior.dragonlandingbehavior.dragontakeoffbehavior.explore_outskirtsbehavior.find_underwater_treasurebehavior.move_to_blockbehavior.move_to_liquidbehavior.random_breachbehavior.random_fly