minecraft:behavior.charge_attack for you with a switch.Get GodCraftOverview
minecraft:behavior.charge_attack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob dash at its target to hurt it, like a vex.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
min_distance | number | 2 | The mob will not charge if the target is closer than this. |
max_distance | number | 3 | The mob will not charge if the target is farther than this. |
speed_multiplier | number | 1 | Speed multiplier while charging. |
success_rate | number | 0.1428 | Chance to start a charge when not already attacking. 1.0 means 100%. |
sound_event | LevelSoundEvent | "charge" | Sound event played when the charge starts. |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.charge_attack": {
"min_distance": 2,
"max_distance": 3,
"speed_multiplier": 1,
"success_rate": 0.1428,
"sound_event": "charge",
"priority": 0,
"control_flags": []
}
}