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

minecraft:behavior.use_kinetic_weapon

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

Overview

minecraft:behavior.use_kinetic_weapon is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets a mob fight with a charging weapon like a spear: it rushes at its target, then backs off and charges again. The weapon item needs minecraft:kinetic_weapon.

Fields

FieldTypeDefaultDescription
approach_distancenumber8The mob starts using its weapon once the target is this close.Range: 0 to …
reposition_distanceFloatRange{"max":2,"min":2}How far the mob backs away after the target gets too close, before charging again. Added to the middle of the weapon's reach.
reposition_speed_multipliernumber1Speed multiplier while backing away to charge again.Range: 0 to …
cooldown_distanceFloatRange{"max":8,"min":8}How far the mob backs away once the weapon's charge time is used up. Added to the middle of the weapon's reach.
cooldown_speed_multipliernumber1Speed multiplier while backing away on cooldown.Range: 0 to …
weapon_reach_multipliernumber1Scales the weapon's reach for this mob.Range: 0 to …
weapon_min_speed_multipliernumber1Scales the minimum speeds the weapon needs to deal damage.Range: 0 to …
hijack_mount_navigationbooleanfalseIf true, the mob steers its mount with this goal. The mount must have the mount_pathing goal.
on_killActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that runs when this mob kills its target.
cooldown_timenumber1Seconds between attacks.Range: 0 to …
melee_fovnumber90Field of view, in degrees, used to spot a target to attack.Range: 0 to …
x_max_rotationnumber30How far, in degrees, the mob can tilt up or down while looking at the target.Range: 0 to …
y_max_head_rotationnumber30How far, in degrees, the mob can turn its head sideways while looking at the target.Range: 0 to …
random_stop_intervalinteger0Gives a 1 in N chance to stop the current attack, where N is this value. Use 0 to never stop at random.Range: 0 to …
attack_oncebooleanfalseIf true, the mob only ever does this attack once in its life.
can_spread_on_firebooleanfalseIf true, a burning mob with an empty hand sets its target on fire when it hits.
min_path_timenumber0.2Shortest base time, in seconds, before the mob plans a new path to the target.Range: 0 to …
max_path_timenumber0.55Longest base time, in seconds, before the mob plans a new path to the target.Range: 0 to …
path_fail_time_increasenumber0.75Extra seconds added before planning a new path when the mob can't follow its current one.Range: 0 to …
inner_boundary_time_increasenumber0.25Extra seconds added before planning a new path when the target is farther than path_inner_boundary.Range: 0 to …
outer_boundary_time_increasenumber0.5Extra seconds added before planning a new path when the target is farther than path_outer_boundary.Range: 0 to …
path_inner_boundarynumber16Distance past which inner_boundary_time_increase is added.Range: 0 to …
path_outer_boundarynumber32Distance past which outer_boundary_time_increase is added.Range: 0 to …
speed_multipliernumber1Speed multiplier while moving toward the target.Range: 0 to …
require_complete_pathbooleanfalseIf true, the mob only chases a target it has a full path to.
track_targetbooleanfalseIf true, the mob keeps tracking the target even without a built-in way to sense it.
attack_typesstring""Which entity types this mob will attack.
on_attackActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that runs each time the mob lands a hit.
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.use_kinetic_weapon": {
    "approach_distance": 8,
    "reposition_distance": {
      "max": 2,
      "min": 2
    },
    "reposition_speed_multiplier": 1,
    "cooldown_distance": {
      "max": 8,
      "min": 8
    },
    "cooldown_speed_multiplier": 1,
    "weapon_reach_multiplier": 1,
    "weapon_min_speed_multiplier": 1,
    "hijack_mount_navigation": false
  }
}

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