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

minecraft:behavior.play

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

Overview

minecraft:behavior.play is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets a mob, usually a villager child, find a friend and play chase with it, running around in random spots nearby.

Fields

FieldTypeDefaultDescription
speed_multipliernumber1Speeds the mob up or slows it down while this goal runs: 1 is normal speed.Range: 0 to …
max_play_duration_secondsnumber50Longest time, in seconds, the mob plays before stopping.Range: 0 to …
chance_to_startnumber0.0025Chance from 0 to 1 that the mob starts playing.Range: 0 to 1
friend_typesEntityTypesnoneWhich entities count as possible playmates.
friend_search_areavec3[6,3,6]Size of the box around the mob used to find a playmate.
random_pos_search_rangeinteger16How far sideways the mob looks for a random spot to run to.Range: 1 to …
random_pos_search_heightinteger3How far up and down the mob looks for a random spot to run to.Range: 1 to …
follow_distanceinteger2How close the mob tries to stay to the friend it follows.Range: 0 to …
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists 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.play": {
    "speed_multiplier": 1,
    "max_play_duration_seconds": 50,
    "chance_to_start": 0.0025,
    "friend_types": {},
    "friend_search_area": [
      6,
      3,
      6
    ],
    "random_pos_search_range": 16,
    "random_pos_search_height": 3,
    "follow_distance": 2
  }
}

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