minecraft:behavior.delayed_attack for you with a switch.Get GodCraftOverview
minecraft:behavior.delayed_attack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Melee AI goal where the damage lands partway through the attack animation instead of right away, like a ravager's bite.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
attack_duration | number | 0.75 | Seconds the attack animation lasts. This also sets the wait between attacks.Range: 0 to … |
hit_delay_pct | number | 0.5 | How far into the animation the damage lands. 0.5 means halfway.Range: 0 to 1 |
sound_event | LevelSoundEvent | "attack.strong" | Sound event played when the attack starts. |
reach_multiplier | number | 1.5 | Multiplied by the mob's size to get how close it must be to hit.Range: 0 to … |
on_kill | ActorDefinitionTrigger | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Event that fires when this mob kills its target. |
melee_fov | number | 90 | Field of view in degrees used to spot a target to hit.Range: 0 to … |
x_max_rotation | number | 30 | Most degrees the mob can tilt up or down while looking at the target.Range: 0 to … |
y_max_head_rotation | number | 30 | Most degrees the mob can turn its head sideways while looking at the target.Range: 0 to … |
random_stop_interval | integer | 0 | Gives a 1 in N chance to stop attacking, where N is this number.Range: 0 to … |
attack_once | boolean | false | If true, the mob only ever does this attack one time. |
can_spread_on_fire | boolean | false | If true, a burning mob with empty hands sets its target on fire when it hits. |
min_path_time | number | 0.2 | Shortest wait in seconds before the path to the target is worked out again.Range: 0 to … |
max_path_time | number | 0.55 | Longest wait in seconds before the path to the target is worked out again.Range: 0 to … |
path_fail_time_increase | number | 0.75 | Seconds added to the path wait when the mob gets stuck.Range: 0 to … |
inner_boundary_time_increase | number | 0.25 | Seconds added to the path wait when the target is past path_inner_boundary.Range: 0 to … |
outer_boundary_time_increase | number | 0.5 | Seconds added to the path wait when the target is past path_outer_boundary.Range: 0 to … |
path_inner_boundary | number | 16 | Distance after which inner_boundary_time_increase is applied.Range: 0 to … |
path_outer_boundary | number | 32 | Distance after which outer_boundary_time_increase is applied.Range: 0 to … |
speed_multiplier | number | 1 | Speed multiplier while moving toward the target.Range: 0 to … |
require_complete_path | boolean | false | If true, the mob only chases when a full path to the target exists. |
track_target | boolean | true | If true, the mob keeps following its target even without a sensing component. |
attack_types | string | "" | Which entity types this mob will attack. |
on_attack | ActorDefinitionTrigger | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Event that fires each time an attack lands. |
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.delayed_attack": {
"attack_duration": 0.75,
"hit_delay_pct": 0.5,
"sound_event": "attack.strong",
"reach_multiplier": 1.5,
"on_kill": {
"event": "",
"filters": {
"AND": null,
"NOT": null,
"OR": null,
"all": null,
"all_of": null,
"any": null,
"any_of": null,
"none_of": null
},
"target": "self"
},
"melee_fov": 90,
"x_max_rotation": 30,
"y_max_head_rotation": 30
}
}