minecraft:behavior.ram_attack
Allows this entity to damage a target by using a running attack.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
run_speed | Decimal | 1 | Sets the entity's speed when running toward the target. |
ram_speed | Decimal | 2 | Sets the entity's speed when charging toward the target. |
ram_distance | Integer | 7 | The distance at which the mob start to run with ram speed. |
min_ram_distance | Integer | 4 | The minimum distance at which the mob can start a ram attack. |
baby_knockback_modifier | Decimal | 0.3333 | The modifier to knockback that babies have. |
knockback_force | Decimal | 5 | The force of the knockback of the ram attack. |
knockback_height | Decimal | 0.1 | The height of the knockback of the ram attack. |
pre_ram_sound | Textitem.use.on, hit, step, step.baby, fly, jump, jump.prevent, break, place, heavy.step, gallop, fall, hurt, hurt.baby, hurt.in.water, death, death.baby, death.in.water, death.to.zombie, ambient, ambient.baby, ambient.in.water, ambient.in.air, ambient.tame … | "undefined" | The sound to play when an entity is about to perform a ram attack. |
ram_impact_sound | Textitem.use.on, hit, step, step.baby, fly, jump, jump.prevent, break, place, heavy.step, gallop, fall, hurt, hurt.baby, hurt.in.water, death, death.baby, death.in.water, death.to.zombie, ambient, ambient.baby, ambient.in.water, ambient.in.air, ambient.tame … | "undefined" | The sound to play when an entity is impacting on a ram attack. |
on_start | List of object | [] | The event to trigger when attacking |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
cooldown_range | Object | {"max": 20, "min": 10} | Minimum and maximum cooldown time-range (positive, in seconds) between each attempted ram attack. |
min | Decimal | 0 | |
max | Decimal | 0 | |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Goat uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.ram_attack": {
"priority": 5,
"run_speed": 0.7,
"ram_speed": 1.8,
"min_ram_distance": 4,
"ram_distance": 7,
"knockback_force": 2.5,
"knockback_height": 0.04,
"pre_ram_sound": "pre_ram.screamer",
"ram_impact_sound": "ram_impact.screamer",
"cooldown_range": {
"min": 5,
"max": 15
},
"on_start": [
{
"event": "start_event",
"target": "self"
}
]
}
}Used by 1
Vanilla entities with minecraft:behavior.ram_attack in their definition:
Related components
behavior.nearest_attackable_targetbehavior.melee_box_attackbehavior.ranged_attackbehavior.stomp_turtle_eggbehavior.leap_at_targetbehavior.nearest_prioritized_attackable_targetbehavior.aquatic_charge_attackbehavior.charge_held_itembehavior.guardian_attackbehavior.ocelotattackbehavior.slime_attackbehavior.charge_attackbehavior.delayed_attackbehavior.dragonchargeplayerbehavior.dragonflamingbehavior.dragonstrafeplayerbehavior.fire_at_targetbehavior.knockback_roarbehavior.melee_attackbehavior.roarbehavior.send_eventbehavior.sonic_boombehavior.stomp_attackbehavior.summon_entity