minecraft:behavior.use_kinetic_weapon
Enables a mob to use kinetic weaponry by intermittently charging at its target and repositioning afterward.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
approach_distance | Decimalmin 0 | 8 | The distance to the target within which the mob begins using its kinetic weapon. |
reposition_distance | Object | {"max": 2, "min": 2} | The distance the mob retreats to once the target is closer than the midpoint of the item's "minecraft:kinetic_weapon" component's minimum and maximum "reach". After reaching this position, the mob will charge again. This value is added to the reach midpoint. |
min | Decimal | 0 | |
max | Decimal | 0 | |
reposition_speed_multiplier | Decimalmin 0 | 1 | Multiplier applied to the mob's movement speed while repositioning. |
cooldown_distance | Object | {"max": 8, "min": 8} | The distance the mob retreats to after all of the item's "minecraft:kinetic_weapon" component's "max_duration" values have elapsed. After reaching this position and once "cooldown" has elapsed, the mob will approach again. This value is added to the reach midpoint. |
min | Decimal | 0 | |
max | Decimal | 0 | |
cooldown_speed_multiplier | Decimalmin 0 | 1 | Multiplier applied to the mob's movement speed while on cooldown. |
weapon_reach_multiplier | Decimalmin 0 | 1 | Multiplier applied to the item's "minecraft:kinetic_weapon" component's "reach". |
weapon_min_speed_multiplier | Decimalmin 0 | 1 | Multiplier applied to each "min_speed" and "min_relative_speed" condition in the item's "minecraft:kinetic_weapon" component. |
hijack_mount_navigation | Boolean | false | Allows the mob to override its mount's navigation behavior with the logic defined by this goal. Requires the mount to be running the "minecraft:behavior.mount_pathing" goal, which default behavior will be ignored. |
on_kill | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Defines the event to trigger when this entity kills the target. |
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_time | Decimalmin 0 | 1 | Cooldown time, in seconds, between consecutive attacks. |
melee_fov | Decimalmin 0 | 90 | Field of view, in degrees, used by the hard-coded sensing component to detect a valid attack target. |
x_max_rotation | Decimalmin 0 | 30 | Maximum rotation, in degrees, on the X-axis while the mob is trying to look at its target. |
y_max_head_rotation | Decimalmin 0 | 30 | Maximum rotation, in degrees, on the Y-axis while the mob is trying to look at its target. |
random_stop_interval | Integermin 0 | 0 | Defines a 1-in-N chance for the mob to stop its current attack, where N equals "random_stop_interval". |
attack_once | Boolean | false | Allows the mob to perform this melee attack behavior only once during its lifetime. |
can_spread_on_fire | Boolean | false | Allows the mob, if on fire and empty handed, to ignite its target upon a successful attack. |
min_path_time | Decimalmin 0 | 0.2 | Minimum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). |
max_path_time | Decimalmin 0 | 0.55 | Maximum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). |
path_fail_time_increase | Decimalmin 0 | 0.75 | Time, in seconds, added to the attack path recalculation interval when the mob cannot move along the current path. |
inner_boundary_time_increase | Decimalmin 0 | 0.25 | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_inner_boundary". |
outer_boundary_time_increase | Decimalmin 0 | 0.5 | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_outer_boundary". |
path_inner_boundary | Decimalmin 0 | 16 | Distance at which to increase attack path recalculation by "inner_boundary_time_increase". |
path_outer_boundary | Decimalmin 0 | 32 | Distance at which to increase attack path recalculation by "outer_boundary_time_increase". |
speed_multiplier | Decimalmin 0 | 1 | Multiplier applied to the mob's movement speed when moving toward its target. |
require_complete_path | Boolean | false | Specifies whether a full navigation path from the mob to the target is required. |
track_target | Boolean | false | Allows the mob to track its target even if it lacks a hard-coded sensing component. |
attack_types | Text | "" | Defines the entity types this entity will attack. |
on_attack | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Defines the event to trigger when this entity successfully attacks. |
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. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Zombie uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.use_kinetic_weapon": {
"approach_distance": 12,
"reposition_distance": {
"min": 8,
"max": 9
},
"reposition_speed_multiplier": 1.4,
"cooldown_distance": {
"min": 11,
"max": 13
},
"cooldown_speed_multiplier": 1.4,
"weapon_reach_multiplier": 0.5,
"weapon_min_speed_multiplier": 0.2,
"hijack_mount_navigation": true,
"speed_multiplier": 1.4,
"track_target": true,
"priority": 3
}
}Used by 5
Vanilla entities with minecraft:behavior.use_kinetic_weapon in their definition:
Related components
behavior.floatbehavior.random_swimbehavior.swim_idlebehavior.swim_wanderbehavior.move_to_waterbehavior.teleport_to_ownerbehavior.float_wanderbehavior.go_homebehavior.random_hoverbehavior.slime_floatbehavior.slime_keep_on_jumpingbehavior.slime_random_directionbehavior.move_to_landbehavior.move_to_random_blockbehavior.circle_around_anchorbehavior.dragonholdingpatternbehavior.dragonlandingbehavior.dragontakeoffbehavior.explore_outskirtsbehavior.find_underwater_treasurebehavior.move_to_blockbehavior.move_to_liquidbehavior.random_breachbehavior.random_fly