minecraft:behavior.ocelotattack for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
cooldown_time | number | 1 | Seconds between attacks. |
x_max_rotation | number | 30 | How far, in degrees, the mob can tilt up or down while looking at the target. |
y_max_head_rotation | number | 30 | How far, in degrees, the mob can turn its head sideways while looking at the target. |
max_distance | number | 15 | The mob only uses this attack when the target is closer than this. |
max_sneak_range | number | 15 | Within this distance the mob starts sneaking toward the target. |
max_sprint_range | number | 4 | Within this distance the mob starts sprinting. Sprinting wins over sneaking. |
reach_multiplier | number | 2 | Multiplied with the mob's size to decide how close it must be to land a hit. |
sneak_speed_multiplier | number | 0.6 | Speed multiplier while sneaking. |
sprint_speed_multiplier | number | 1.33 | Speed multiplier while sprinting. |
walk_speed_multiplier | number | 0.8 | Speed multiplier when walking in attack range without sneaking or sprinting. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists 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
}
}