minecraft:behavior.stalk_and_pounce_on_target for you with a switch.Get GodCraftOverview
minecraft:behavior.stalk_and_pounce_on_target is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob sneak up on its target and then leap onto it, dealing the damage from minecraft:attack. If the pounce misses, the mob can get stuck for a moment. Foxes hunt this way.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
stalk_speed | number | 1.2 | Speed while sneaking up on the target. |
max_stalk_dist | number | 10 | If the target gets farther than this, the mob stops stalking. |
leap_height | number | 0.9 | How high, in blocks, the mob jumps when it pounces. |
leap_dist | number | 0.8 | How far forward, in blocks, the mob jumps when it pounces. |
pounce_max_dist | number | 5 | The mob starts its pounce once the target is closer than this. |
strike_dist | number | 2 | How close the mob must land to the target for the pounce to hurt it. |
interest_time | number | 2 | How long the mob waits, crouched and ready, before pouncing. |
stuck_time | number | 2 | How long the mob stays stuck after a missed pounce. |
set_persistent | boolean | false | If true, the mob will not despawn after it targets a player. |
stuck_blocks | Filter Group | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | Which blocks the mob can get stuck in after a missed pounce, like snow. |
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.stalk_and_pounce_on_target": {
"stalk_speed": 1.2,
"max_stalk_dist": 10,
"leap_height": 0.9,
"leap_dist": 0.8,
"pounce_max_dist": 5,
"strike_dist": 2,
"interest_time": 2,
"stuck_time": 2
}
}