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

minecraft:behavior.ocelotattack

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

Overview

minecraft:behavior.ocelotattack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. The sneak-and-pounce attack used by ocelots and cats. The mob creeps up on its target, then sprints and leaps at it.

Fields

FieldTypeDefaultDescription
cooldown_timenumber1Seconds between attacks.
x_max_rotationnumber30How far, in degrees, the mob can tilt up or down while looking at the target.
y_max_head_rotationnumber30How far, in degrees, the mob can turn its head sideways while looking at the target.
max_distancenumber15The mob only uses this attack when the target is closer than this.
max_sneak_rangenumber15Within this distance the mob starts sneaking toward the target.
max_sprint_rangenumber4Within this distance the mob starts sprinting. Sprinting wins over sneaking.
reach_multipliernumber2Multiplied with the mob's size to decide how close it must be to land a hit.
sneak_speed_multipliernumber0.6Speed multiplier while sneaking.
sprint_speed_multipliernumber1.33Speed multiplier while sprinting.
walk_speed_multipliernumber0.8Speed multiplier when walking in attack range without sneaking or sprinting.
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.ocelotattack": {
    "cooldown_time": 1,
    "x_max_rotation": 30,
    "y_max_head_rotation": 30,
    "max_distance": 15,
    "max_sneak_range": 15,
    "max_sprint_range": 4,
    "reach_multiplier": 2,
    "sneak_speed_multiplier": 0.6
  }
}

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