minecraft:behavior.guardian_attack for you with a switch.Get GodCraftOverview
minecraft:behavior.guardian_attack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Guardian and elder guardian only: aims a laser beam at the target and hurts it once the beam is charged.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
magic_damage | integer | 1 | Damage of the laser, added on top of the mob's normal attack damage. |
hard_mode_extra_magic_damage | integer | 2 | Extra laser damage on hard difficulty. |
elder_extra_magic_damage | integer | 2 | Extra laser damage dealt by an elder guardian. |
sound_delay_time | number | 0.5 | Seconds after the attack starts before the attack sound plays. |
x_max_rotation | number | 90 | Most degrees the mob can tilt up or down while aiming. |
y_max_head_rotation | number | 90 | Most degrees the head can turn sideways while aiming. |
min_distance | number | 3 | The attack stops if the target comes closer than this. Elder guardians ignore it.Range: 0 to … |
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.guardian_attack": {
"magic_damage": 1,
"hard_mode_extra_magic_damage": 2,
"elder_extra_magic_damage": 2,
"sound_delay_time": 0.5,
"x_max_rotation": 90,
"y_max_head_rotation": 90,
"min_distance": 3,
"priority": 0
}
}