1. Wiki
  2. /Entities
  3. /minecraft:projectile

minecraft:projectile

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

Overview

minecraft:projectile is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the entity behave like a thrown or fired object, such as an arrow or snowball: it flies in an arc and does something when it hits. Use the on_hit settings to choose what happens on impact.

Fields

FieldTypeDefaultDescription
offsetvec3[0,0,0]Where the projectile appears, measured from the anchor point on the shooter.
anchorProjectileAnchor"origin"Which point on the shooter to launch from: 0 feet, 1 eyes, 2 middle of the body.
powernumber1.3How fast the projectile leaves the shooter, in blocks per tick.
angle_offsetnumber0Extra upward tilt in degrees added to the aim; negative aims lower.
uncertainty_basenumber0How inaccurate the shot is; higher numbers spread shots more.
uncertainty_multipliernumber0How much the inaccuracy shrinks per difficulty level, so harder difficulties shoot straighter.
shoot_targetbooleantrueIf true, the shot aims at the shooter's target instead of straight ahead.
gravitynumber0.05How quickly the projectile drops each tick; set it to 0 for a straight line.
inertianumber0.99How much speed it keeps each tick in the air; below 1 it slows down.
liquid_inertianumber0.6How much speed it keeps each tick while moving through water or lava.
isolated_physicsbooleantrueIf true, it uses its own simple flight physics and ignores normal friction and drag. A good choice for custom projectiles.
homingbooleanfalseIf true, the projectile curves toward its target while flying.
should_bounceShouldBounce"no"When it bounces off an entity: never, only off invulnerable ones, or whenever it deals no damage.
multiple_targetsbooleanfalseIf true, it can pass through and hit several entities, like a piercing arrow.
hit_nearest_passengerbooleanfalseIf true, hitting a ridden vehicle affects the closest rider instead of the vehicle.
ignored_entitiesEntity Reference[]noneEntity types the projectile flies through without hitting.
is_dangerousbooleanfalseIf true, mobs treat the projectile as a threat and may react to it.
reflect_on_hurtbooleanfalseIf true, hitting the projectile sends it back toward the attacker, like a ghast fireball.
reflect_immunitynumber0Seconds after launch during which the projectile can't be knocked back.
destroy_on_hurtbooleanfalseIf true, the projectile is removed when something hits it.
stop_on_hurtbooleanfalseIf true, the projectile stops moving when something hits it.
crit_particle_on_hurtbooleanfalseIf true, critical hit sparkles appear when the projectile is struck.
particleParticleType"iconcrack"Particle shown where the projectile hits.
shoot_soundstring""Sound played when the projectile is fired.
hit_soundstring""Sound played when it hits an entity, and also blocks if no ground sound is set.
hit_ground_soundstring""Sound played when it hits a block.
catch_firebooleanfalseOld way to set targets on fire; prefer the catch_fire option inside on_hit.
on_fire_timenumber5How many seconds a target burns after being set on fire by this projectile.
lightningbooleanfalseIf true, it can call down lightning on the entity it hits during a thunderstorm, like a channeling trident.
potion_effectinteger-1Potion type the projectile carries, usually filled in by potion items.
splash_rangenumber4Radius in blocks for splash potion effects.
on_hitOnHitCommandsStoragenoneWhat happens on impact, such as dealing damage, spawning an entity or removing the projectile.
hit_waterbooleanfalseIf true, the projectile stops when it touches water.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:projectile": {
    "offset": [
      0,
      0,
      0
    ],
    "anchor": "origin",
    "power": 1.3,
    "angle_offset": 0,
    "uncertainty_base": 0,
    "uncertainty_multiplier": 0,
    "shoot_target": true,
    "gravity": 0.05
  }
}

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