minecraft:behavior.play
Allows the mob to offer a flower to another mob with the minecraft:take_flower behavior.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
speed_multiplier | Decimalmin 0 | 1 | Movement speed multiplier of the mob when using this AI Goal. |
max_play_duration_seconds | Decimalmin 0 | 50 | The max amount of seconds that the mob will play for before exiting the Goal. |
chance_to_start | Decimal0 to 1 | 0.0025 | Percent chance that the mob will start this goal, from 0 to 1. |
friend_types | List of object or Object | [] | The entity type(s) to consider when searching for a potential friend to play with. |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that make this entry in the list valid |
max_dist | Decimal | 16 | Maximum distance this mob can be away to be a valid choice |
max_height | Decimal | -1 | Maximum height this mob can be away to be a valid choice |
max_flee | Decimal | 10 | Maximum distance this mob can be from the target to stop fleeing |
walk_speed_multiplier | Decimal | 1 | Multiplier for the walking speed. A value of 1.0 means the speed is unchanged |
sprint_speed_multiplier | Decimal | 1 | Multiplier for the sprinting speed. A value of 1.0 means the speed is unchanged |
priority | Integer | 0 | Priority for this mob type |
check_if_outnumbered | Boolean | false | If true, the mob will check if its outnumbered |
reevaluate_description | Boolean | false | If true, the mob will stop being targeted if it stops meeting any conditions. |
cooldown | Integer | 0 | The amount of time in seconds that the mob has to wait before selecting a target of the same type again |
must_see | Boolean | — | If true, the mob has to be visible to be a valid choice |
must_see_forget_duration | Integer | 3 | Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more |
friend_search_area | List of decimal or Object | [6, 3, 6] | The dimensions of the AABB used to search for a potential friend to play with. |
x | Decimal | 0 | |
y | Decimal | 0 | |
z | Decimal | 0 | |
random_pos_search_range | Integermin 1 | 16 | The distance (in blocks) on ground that the mob will search within to find a random position to move to. Must be at least 1. |
random_pos_search_height | Integermin 1 | 3 | The height (in blocks) that the mob will search within to find a random position position to move to. Must be at least 1. |
follow_distance | Integermin 0 | 2 | The distance (in blocks) that the mob tries to be in range of the friend it's following. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.play": {
"friend_types": [
{
"filters": {
"all_of": [
{
"subject": "other",
"test": "is_family",
"value": "villager"
},
{
"operator": "==",
"test": "is_baby",
"subject": "other",
"value": true
}
]
}
}
],
"priority": 8,
"speed_multiplier": 0.6
}
}Used by 2
Vanilla entities with minecraft:behavior.play in their definition:
Related components
behavior.look_at_playerbehavior.temptbehavior.breedbehavior.mount_pathingbehavior.follow_parentbehavior.player_ride_tamedbehavior.find_mountbehavior.celebratebehavior.follow_ownerbehavior.stay_while_sittingbehavior.look_at_trading_playerbehavior.random_look_around_and_sitbehavior.take_flowerbehavior.trade_with_playerbehavior.celebrate_survivebehavior.controlled_by_playerbehavior.follow_caravanbehavior.follow_mobbehavior.make_lovebehavior.ocelot_sit_on_blockbehavior.receive_lovebehavior.share_itemsbehavior.trade_interestbehavior.admire_item