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

minecraft:behavior.aquatic_charge_attack

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

Overview

minecraft:behavior.aquatic_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 for water mobs that rush at their target and knock it back on hit, then rest before the next rush.

Fields

FieldTypeDefaultDescription
max_charge_distancenumber16The farthest a target can be for the mob to try a charge.Range: 0 to …
charge_speednumber0.06How fast the mob swims while charging.Range: 0.05000000074505806 to …
attack_reachnumber0.05Extra distance added around the mob's hitbox that still counts as a hit.Range: 0 to …
knockback_forcenumber2How hard the target is pushed when hit.Range: 0 to …
charge_overshoot_distancenumber1.5How far past the target the mob aims, so it rushes through instead of stopping short.Range: 0 to …
charge_cooldown_timeFloatRange{"max":6,"min":2}Random wait range in seconds before the next charge.
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.aquatic_charge_attack": {
    "max_charge_distance": 16,
    "charge_speed": 0.06,
    "attack_reach": 0.05,
    "knockback_force": 2,
    "charge_overshoot_distance": 1.5,
    "charge_cooldown_time": {
      "max": 6,
      "min": 2
    },
    "priority": 0,
    "control_flags": []
  }
}

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