minecraft:behavior.ocelotattack
Controls specific attack behavior for Ocelots.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
cooldown_time | Decimal | 1 | Time (in seconds) between attacks. |
x_max_rotation | Decimal | 30 | Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. |
y_max_head_rotation | Decimal | 30 | Maximum rotation (in degrees), on the Y-axis, this entity's head can rotate while trying to look at the target. |
max_distance | Decimal | 15 | Max distance from the target, this entity will use this attack behavior. |
max_sneak_range | Decimal | 15 | Max distance from the target, this entity starts sneaking. |
max_sprint_range | Decimal | 4 | Max distance from the target, this entity starts sprinting (sprinting takes priority over sneaking). |
reach_multiplier | Decimal | 2 | Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. |
sneak_speed_multiplier | Decimal | 0.6 | Modifies the attacking entity's movement speed while sneaking. |
sprint_speed_multiplier | Decimal | 1.33 | Modifies the attacking entity's movement speed while sprinting. |
walk_speed_multiplier | Decimal | 0.8 | Modifies the attacking entity's movement speed when not sneaking or sprinting, but still within attack range. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Cat uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.ocelotattack": {
"priority": 4,
"cooldown_time": 1.0,
"x_max_rotation": 30.0,
"y_max_head_rotation": 30.0,
"max_distance": 15.0,
"max_sneak_range": 15.0,
"max_sprint_range": 4.0,
"reach_multiplier": 2.0,
"sneak_speed_multiplier": 0.6,
"sprint_speed_multiplier": 1.33,
"walk_speed_multiplier": 0.8
}
}Used by 2
Vanilla entities with minecraft:behavior.ocelotattack 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.slime_attackbehavior.charge_attackbehavior.delayed_attackbehavior.dragonchargeplayerbehavior.dragonflamingbehavior.dragonstrafeplayerbehavior.fire_at_targetbehavior.knockback_roarbehavior.melee_attackbehavior.ram_attackbehavior.roarbehavior.send_eventbehavior.sonic_boombehavior.stomp_attackbehavior.summon_entity