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

minecraft:behavior.ram_attack

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

Overview

minecraft:behavior.ram_attack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets the mob charge at its target with its head and knock it back, like a goat ramming.

Fields

FieldTypeDefaultDescription
run_speednumber1Speed while running toward the target before the charge.
ram_speednumber2Speed during the charge itself.
ram_distanceinteger7Distance at which the mob switches to its charging speed.
min_ram_distanceinteger4The mob only starts a ram if the target is at least this far away.
baby_knockback_modifiernumber0.333333Changes how strong the knockback is when a baby rams.
knockback_forcenumber5How hard the ram pushes the target away.
knockback_heightnumber0.1How high the ram lifts the target.
pre_ram_soundLevelSoundEvent"undefined"Sound played just before the charge starts.
ram_impact_soundLevelSoundEvent"undefined"Sound played when the ram hits.
on_startActorDefinitionTrigger[]noneEvent that runs when the ram attack begins.
cooldown_rangeFloatRange{"max":20,"min":10}Random wait, in seconds, between ram attempts.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.ram_attack": {
    "run_speed": 1,
    "ram_speed": 2,
    "ram_distance": 7,
    "min_ram_distance": 4,
    "baby_knockback_modifier": 0.333333,
    "knockback_force": 5,
    "knockback_height": 0.1,
    "pre_ram_sound": "undefined"
  }
}

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