minecraft:behavior.play for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
speed_multiplier | number | 1 | Speeds the mob up or slows it down while this goal runs: 1 is normal speed.Range: 0 to … |
max_play_duration_seconds | number | 50 | Longest time, in seconds, the mob plays before stopping.Range: 0 to … |
chance_to_start | number | 0.0025 | Chance from 0 to 1 that the mob starts playing.Range: 0 to 1 |
friend_types | EntityTypes | none | Which entities count as possible playmates. |
friend_search_area | vec3 | [6,3,6] | Size of the box around the mob used to find a playmate. |
random_pos_search_range | integer | 16 | How far sideways the mob looks for a random spot to run to.Range: 1 to … |
random_pos_search_height | integer | 3 | How far up and down the mob looks for a random spot to run to.Range: 1 to … |
follow_distance | integer | 2 | How close the mob tries to stay to the friend it follows.Range: 0 to … |
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.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
}
}