1. Wiki
  2. /Entities
  3. /minecraft:behavior.guardian_attack

minecraft:behavior.guardian_attack

Don't want to write this by hand? GodCraft sets minecraft:behavior.guardian_attack for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
magic_damageinteger1Damage of the laser, added on top of the mob's normal attack damage.
hard_mode_extra_magic_damageinteger2Extra laser damage on hard difficulty.
elder_extra_magic_damageinteger2Extra laser damage dealt by an elder guardian.
sound_delay_timenumber0.5Seconds after the attack starts before the attack sound plays.
x_max_rotationnumber90Most degrees the mob can tilt up or down while aiming.
y_max_head_rotationnumber90Most degrees the head can turn sideways while aiming.
min_distancenumber3The attack stops if the target comes closer than this. Elder guardians ignore it.Range: 0 to …
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich 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
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more