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

minecraft:behavior.charge_attack

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

Overview

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

FieldTypeDefaultDescription
min_distancenumber2The mob will not charge if the target is closer than this.
max_distancenumber3The mob will not charge if the target is farther than this.
speed_multipliernumber1Speed multiplier while charging.
success_ratenumber0.1428Chance to start a charge when not already attacking. 1.0 means 100%.
sound_eventLevelSoundEvent"charge"Sound event played when the charge starts.
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.charge_attack": {
    "min_distance": 2,
    "max_distance": 3,
    "speed_multiplier": 1,
    "success_rate": 0.1428,
    "sound_event": "charge",
    "priority": 0,
    "control_flags": []
  }
}

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