minecraft:behavior.play

Allows the mob to offer a flower to another mob with the minecraft:take_flower behavior.

Properties

PropertyTypeDefaultWhat it does
speed_multiplierDecimalmin 01Movement speed multiplier of the mob when using this AI Goal.
max_play_duration_secondsDecimalmin 050The max amount of seconds that the mob will play for before exiting the Goal.
chance_to_startDecimal0 to 10.0025Percent chance that the mob will start this goal, from 0 to 1.
friend_typesList of object or Object[]The entity type(s) to consider when searching for a potential friend to play with.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Conditions that make this entry in the list valid
max_distDecimal16Maximum distance this mob can be away to be a valid choice
max_heightDecimal-1Maximum height this mob can be away to be a valid choice
max_fleeDecimal10Maximum distance this mob can be from the target to stop fleeing
walk_speed_multiplierDecimal1Multiplier for the walking speed. A value of 1.0 means the speed is unchanged
sprint_speed_multiplierDecimal1Multiplier for the sprinting speed. A value of 1.0 means the speed is unchanged
priorityInteger0Priority for this mob type
check_if_outnumberedBooleanfalseIf true, the mob will check if its outnumbered
reevaluate_descriptionBooleanfalseIf true, the mob will stop being targeted if it stops meeting any conditions.
cooldownInteger0The amount of time in seconds that the mob has to wait before selecting a target of the same type again
must_seeBoolean—If true, the mob has to be visible to be a valid choice
must_see_forget_durationInteger3Determines 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_areaList of decimal or Object[6, 3, 6]The dimensions of the AABB used to search for a potential friend to play with.
xDecimal0
yDecimal0
zDecimal0
random_pos_search_rangeIntegermin 116The 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_heightIntegermin 13The height (in blocks) that the mob will search within to find a random position position to move to. Must be at least 1.
follow_distanceIntegermin 02The distance (in blocks) that the mob tries to be in range of the friend it's following.
priorityIntegermin 00
control_flagsList 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