Projectiles

Overview

This page intends to document all different fields you can use inside minecraft:projectile entity behavior component.

WARNING

Disclaimer: this component has been mostly documented based on projectiles found in the game or reverse engineering the game.This information was last tested on 1.18.2.

NameTypeDefault ValueDescription
anchorInteger
angle_offsetDecimal0Determines the angle at which the projectile is thrown
catch_fireBooleanfalseIf true, the entity hit will be set on fire
crit_particle_on_hurtBooleanfalseIf true, the projectile will produce critical hit particles when it happens
destroy_on_hurtBooleanfalseIf true, this entity will be destroyed when hit
filterStringEntity Definitions defined here can't be hurt by the projectile
fire_affected_by_griefingBooleanfalseIf true, whether the projectile causes fire is affected by the mob griefing game rule
gravityDecimal0.05The gravity applied to this entity when thrown. The higher the value, the faster the entity falls
hit_ground_soundStringThe sound that plays when the projectile hits ground
hit_soundStringThe sound that plays when the projectile hits an entity
homingBooleanfalseIf true, the projectile homes in to the nearest. Does not work on 1.18.2 entity
inertiaDecimal0.99The fraction of the projectile's speed maintained every frame while traveling in air
is_dangerousBooleanfalseIf true, the projectile will be treated as dangerous to the players
knockbackBooleantrueIf true, the projectile will knock back the entity it hits
lightningBooleanfalseIf true, the entity hit will be struck by lightning
liquid_inertiaDecimal0.6The fraction of the projectile's speed maintained every frame while traveling in water
multiple_targetsBooleantrueIf true, the projectile can hit multiple entities per flight
offsetVector [a, b, c][0, 0.5, 0]The offset from the entity's anchor where the projectile will spawn
on_fire_timeDecimal5Time in seconds that the entity hit will be on fire for
on_hitObjectProjectile's behavior on hit. More info below
particleStringiconcrackParticle to use upon collision
potion_effectInteger-1Defines the effect the arrow will apply to the entity it hits
powerDecimal1.3Determines the velocity of the projectile
reflect_on_hurtBooleanfalseIf true, this entity will be reflected back when hit
semi_random_diff_damageBooleanfalseIf true, damage will be randomized based on damage and speed
shoot_soundStringThe sound that plays when the projectile is shot
shoot_targetBooleantrueIf true, the projectile will be shot towards the target of the entity firing it
should_bounceBooleanfalseIf true, the projectile will bounce upon hit
splash_potionBooleanfalseIf true, the projectile will be treated like a splash potion
splash_rangeDecimal4Radius in blocks of the 'splash' effect
stop_on_hurtBoolean
uncertainty_baseDecimal0The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier
uncertainty_multiplierDecimal0Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier
hit_waterBooleanfalseIf true, liquid blocks will be treated as solid. Requires "Education Edition" toggle active

on_hit

This object contains all behaviors, that can be executed, when projectile hits something.

arrow_effect

Exact behavior unknown

teleport_owner

Teleports shooter to the hit location.

catch_fire

Exact behavior unknown

Sets target on fire

ignite

Exact behavior unknown

Sets target on fire

remove_on_hit

Removes the projectile when it hits something.

douse_fire

Exact behavior unknown

impact_damage

Deals damage on hit.

NameTypeDescription
damageInteger/Integer Array [min, max]Damage dealt to entity on hit
semi_random_diff_damageBoolean
max_critical_damageDecimal
min_critical_damageDecimal
power_multiplierDecimal
channelingBoolean
set_last_hurt_requires_damageBoolean
destroy_on_hit_requires_damageBoolean
filterStringEntity to affect. Much more primitive than filters used elsewhere, as it cannot "test" for anything other than an identifier
destroy_on_hitBoolean
knockbackBoolean
catch_fireBooleanDictates wether or not targets will be engulfed in flames

definition_event

Calls an event on hit.

NameTypeDescription
affect_projectileBooleanEvent will be triggered for projectile entity
affect_shooterBooleanEvent will be triggered for shooter entity
affect_targetBooleanEvent will be triggered for hit entity
affect_splash_areaBooleanEvent will be triggered for all entities in an area
splash_areaDecimalArea of entities
event_triggerObjectEvent to trigger. Structure below.
NameTypeDescription
eventStringEvent to trigger
targetStringTarget of the event
filtersObjectCriteria required in order to trigger

stick_in_ground

Sticks the projectile into the ground.

NameTypeDescription
shake_timeDecimal

spawn_aoe_cloud

Spawns an area of effect cloud of potion effect.

NameTypeDescription
radiusDecimalRadius of the cloud
radius_on_useDecimal
potionIntegerLingering Potion ID
particleStringVanilla Particles emitter of the cloud. Only accepts Vanilla Particles. dragonbreath enables the usage of Bottles to obtain Dragon's Breath.
durationIntegerDuration of the cloud in seconds
colorInteger array [r, g, b]Color of the particles
affect_ownerBooleanIs potion effect affecting the shooter. Does not appear to apply to the player
reapplication_delayIntegerDelay in ticks between application of the potion effect

Potion IDs

PotionRegularExtendedEnhanced (Level II)
Water Bottle0
Mundane Potion12
Thick Potion3
Awkward Potion4
Potion of Night Vision56
Potion of Invisibility78
Potion of Leaping91011
Potion of Fire Resistance1213
Potion of Swiftness141516
Potion of Slowness1718
Potion of Water Breathing1920
Potion of Healing2122
Potion of Harming2324
Potion of Poison252627
Potion of Regeneration282930
Potion of Strength313233
Potion of Weakness3435
Potion of Decay36
Potion of Turtle Master373839
Potion of Slow Falling4041
Potion of Slowness IV42
Potion of Crashing43+

spawn_chance

Spawns an entity on hit.

NameTypeDescription
first_spawn_percent_chanceDecimal
second_spawn_percent_chanceDecimal
first_spawn_countInteger
second_spawn_countInteger
spawn_definitionStringID of the entity to spawn
spawn_babyBooleanWhether the spawned entity should be a baby

particle_on_hit

Spawns particles on hit.

NameTypeDescription
particle_typeStringVanilla Particles to use
num_particlesIntegerNumber of particles
on_entity_hitBooleanWhether it should spawn particles on entity hit
on_other_hitBooleanWhether it should spawn particles on other hit

mob_effect

Applies a mob effect to the target.

NameTypeDescription
effectStringEffect
durationIntegerDuration of the effect
durationeasyIntegerDuration of the effect on easy difficulty
durationnormalIntegerDuration of the effect on normal difficulty
durationhardIntegerDuration of the effect on hard difficulty
amplifierIntegerEffect amplifier
ambientBoolean
visibleBoolean

grant_xp

Despite the name, this actually spawns a number of experience orbs, being worth the amount stated.

NameTypeDescription
minXPIntegerMinimum amount of experience to give
maxXPIntegerMaximum amount of experience to give
xpIntegerConstant amount of experience to give. When set, it will be used instead of min and max values.

freeze_on_hit

Exact behavior unknown

Requires Education Edition toggle to be enabled. Freezes water on hit.

NameTypeDescription
shapeString"sphere" or "cube"
snap_to_blockBoolean
sizeIntegerThe size of the freeze effect

hurt_owner

Exact behavior unknown. Right now it crashes minecraft probably because of wrong parameters

NameTypeDescription
owner_damageInteger
knockbackBoolean
igniteBoolean

thrown_potion_effect

Exact behavior unknown. Right now it crashes minecraft probably because it's only valid for thrown potions

Additional Information

When it comes to creating a custom projectile, such as an arrow or trident variant, or something entirely your own, you may want to consider defining a runtime identifier to ensure that it acts as intended. Not doing so may result in unintended behaviour, from odd visuals to incorrect knockback direction and arrows that you can kill with your bare hands.

Contributors