跳转至

Projectile

文档版本:1.21.0.24

Allows the entity to be a thrown entity.

架构

projectile:
{
  integer "anchor" : opt
  number "angle_offset" : opt
  boolean "catch_fire" : opt
  boolean "crit_particle_on_hurt" : opt
  boolean "destroy_on_hurt" : opt
  string "filter" : opt
  boolean "fire_affected_by_griefing" : opt
  number "gravity" : opt
  sound_event "hit_ground_sound"
  sound_event "hit_sound"
  boolean "homing" : opt
  number "inertia" : opt
  boolean "is_dangerous" : opt
  boolean "knockback" : opt
  boolean "lightning" : opt
  number "liquid_inertia" : opt
  boolean "multiple_targets" : opt
   "mob_effect" : opt
  vector_of_3_items "offset"
  number "on_fire_time" : opt
  object "on_hit" : opt
  {
    object "arrow_effect" : opt
    {
      boolean "apply_effect_to_blocking_targets" : opt
    }
    boolean "catch_fire" : opt
    object "definition_event" : opt
    {
      boolean "affect_projectile" : opt
      boolean "affect_shooter" : opt
      boolean "affect_splash_area" : opt
      boolean "affect_target" : opt
      event "event_trigger"
      number "splash_area" : opt
    }
    boolean "douse_fire" : opt
    object "freeze_on_hit" : opt
    {
      string "shape" : opt
      boolean "snap_to_block" : opt
      number "size" : opt
    }
    object "grant_xp" : opt
    {
      number "minXP" : opt
      number "maxXP" : opt
    }
    object "hurt_owner" : opt
    {
      number "owner_damage" : opt
      boolean "knockback" : opt
      boolean "ignite" : opt
    }
    boolean "ignite" : opt
    object "impact_damage" : opt
    {
      boolean "catch_fire" : opt
      boolean "channeling" : opt
      number "damage" : opt
      array "damage" : opt
      {
        number "0..0" : opt
        number "1..1" : opt
      }
      boolean "destroy_on_hit" : opt
      boolean "destroy_on_hit_requires_damage" : opt
      string "filter" : opt
      boolean "knockback" : opt
      integer "max_critical_damage" : opt
      integer "min_critical_damage" : opt
      number "power_multiplier" : opt
      boolean "semi_random_diff_damage" : opt
      boolean "set_last_hurt_requires_damage" : opt
      boolean "should_bounce" : opt
    }
    object "mob_effect" : opt
    {
      boolean "ambient" : opt
      integer "amplifier" : opt
      integer "duration" : opt
      integer "durationeasy" : opt
      integer "durationhard" : opt
      integer "durationnormal" : opt
      string "effect" : opt
      boolean "visible" : opt
    }
    number "on_fire_time" : opt
    object "particle_on_hit" : opt
    {
      number "num_particles" : opt
      boolean "on_entity_hit" : opt
      boolean "on_other_hit" : opt
      string "particle_type" : opt
    }
    integer "potion_effect" : opt
    object "remove_on_hit" : opt
    {
    }
    object "spawn_aoe_cloud" : opt
    {
      boolean "affect_owner" : opt
      vector_of_3_items "color"
      integer "duration" : opt
      string "particle" : opt
      integer "potion" : opt
      number "radius" : opt
      number "radius_on_use" : opt
      integer "reapplication_delay" : opt
    }
    object "spawn_chance" : opt
    {
      integer "first_spawn_count" : opt
      number "first_spawn_percent_chance" : opt
      number "first_spawn_chance" : opt
      number "second_spawn_chance" : opt
      integer "second_spawn_count" : opt
      boolean "spawn_baby" : opt
      string "spawn_definition" : opt
    }
    object "stick_in_ground" : opt
    {
    }
    boolean "teleport_owner" : opt
    object "thrown_potion_effect" : opt
    {
    }
  }
  string "particle" : opt
  integer "potion_effect" : opt
  number "power" : opt
  boolean "reflect_on_hurt" : opt
  boolean "semi_random_diff_damage" : opt
  sound_event "shoot_sound"
  boolean "shoot_target" : opt
  boolean "should_bounce" : opt
  boolean "splash_potion" : opt
  number "splash_range" : opt
  boolean "stop_on_hurt" : opt
  number "uncertainty_base" : opt
  number "uncertainty_multiplier" : opt
}
anchorinteger
Allows you to choose an anchor point for where the projectile is fired from. 0 = Original point, 1 = EyeHeight, and 2 = Middle or body height.
angle_offsetnumber
Alters the angle at which a projectile is vertically shot. Many splash potions in the game use this to offset their angles by -20 degrees.
catch_fireboolean
If true, the entity hit will be set on fire.
crit_particle_on_hurtboolean
If true, when a projectile deals damage, whether or not to spawn in the critical damage particles.
destroy_on_hurtboolean
When this projectile deals damage, whether or not to immediately destroy this projectile.
filterstring
Entity Definitions defined here can't be hurt by the projectile.
fire_affected_by_griefingboolean
If true, whether the projectile causes fire is affected by the mob griefing game rule.
gravitynumber
The gravity applied to this entity when thrown. When this actor is not on the ground, subtracts this amount from the actors change in vertical position every tick. The higher the value, the faster the entity falls.
hit_ground_soundsound_event
The sound that plays when the projectile hits the ground.
sound_event:
string
hit_soundsound_event
The sound that plays when the projectile hits something.
homingboolean
If true, the projectile homes in to the nearest entity.
inertianumber
The fraction of the projectile's speed maintained every frame while traveling in air.
is_dangerousboolean
If true, the projectile will be treated as dangerous to the players.
knockbackboolean
If true, the projectile will knock back the entity it hits.
lightningboolean
If true, the entity hit will be struck by lightning.
liquid_inertianumber
The fraction of the projectile's speed maintained every frame while traveling in water.
multiple_targetsboolean
If true, the projectile can hit multiple entities per flight.
mob_effect
SEE on_hit/mob_effect.
offsetvector_of_3_items
The offset from the entity's anchor where the projectile will spawn.
vector_of_3_items:
array
{
  number "0..0" : opt
  number "1..1" : opt
  number "2..2" : opt
}
0..0number
The X component.
1..1number
The Y component.
2..2number
The Z component.
on_fire_timenumber
Time in seconds that the entity hit will be on fire for.
on_hitobject
Defines the behaviors that may execute on a projectile's hit, including impact damage, impact effect, and stuck in ground. See more on these parameters below.
on_hit
arrow_effectobject
The target receives a mob effect. See the table below for all arrow_effect parameters.
arrow_effect
apply_effect_to_blocking_targetsboolean
If true, the effect will be applied to blocking targets.
catch_fireboolean
Determines if the struck object is set on fire.
definition_eventobject
The event that is triggered on a hit. See the table below for all definition event parameters.
definition_event
affect_projectileboolean
The projectile that will be affected by this event.
affect_shooterboolean
The shooter that will be affected by this event.
affect_splash_areaboolean
All entities in the splash area will be affected by this event.
affect_targetboolean
The target will be affected by this event.
event_triggerevent
The event triggered. Also has an option filters parameter to limit affected targets.
event:
string
event:
{
  string "event" : opt
  string "target" : opt
}
eventstring
The event to fire.
targetstring
The target of the event.
splash_areanumber
The splash area that will be affected.
douse_fireboolean
If the target is on fire, then douse the fire.
freeze_on_hitobject
An area of entities that is frozen to block on hits. Has shape of either sphere or cube, snap_to_block boolean ,and size decimal properties.
freeze_on_hit
shapestring
The shape of the area that is frozen.
snap_to_blockboolean
If true, the area will snap to the nearest block.
sizenumber
The size of the area that is frozen.
grant_xpobject
Grants XP on hit. Has minXP for minimum XP granted, maxXp for maximum, or simply flat xp properties.
grant_xp
minXPnumber
The minimum XP granted.
maxXPnumber
The maximum XP granted.
hurt_ownerobject
Determines if the owner of the entity is hurt on hit. Contains decimal owner_damage, knockback boolean, and ignite boolean.
hurt_owner
owner_damagenumber
The amount of damage the owner will take.
knockbackboolean
If true, the owner will be knocked back.
igniteboolean
If true, the owner will be set on fire.
igniteboolean
Determines if a fire may be started on a flammable target.
impact_damageobject
Defines the damage that an entity may receive on being hit by this projectile. See the table below for all impact_damage parameters.
impact_damage
catch_fireboolean
Determines if the struck object is set on fire.
channelingboolean
Whether lightning can be channeled through hte weapon.
damagenumber
The damage dealt on impact.
damagearray
The damage dealt on impact.
damage
0..0number
1..1number
destroy_on_hitboolean
Projectile is removed on hit.
destroy_on_hit_requires_damageboolean
If true, then the hit must cause damage to destroy the projectile.
filterstring
The identifier of an entity that can be hit.
knockbackboolean
If true, the projectile will knock back the entity it hits.
max_critical_damageinteger
Maximum critical damage.
min_critical_damageinteger
Minimum critical damage.
power_multipliernumber
How much the base damage is multiplied.
semi_random_diff_damageboolean
If true, damage will be randomized based on damage and speed.
set_last_hurt_requires_damageboolean
If true, then the hit must cause damage to update the last hurt property.
should_bounceboolean
If true, the projectile will bounce
mob_effectobject
The target receives a mob effect. See the table below for all mob_effect parameters.
mob_effect
ambientboolean
If true, a mob will spawn that is not hostile, like the bat entity in Minecraft.
amplifierinteger
The multiplier of the amplification of this effect.
durationinteger
The effect's duration.
durationeasyinteger
The effect's duration on easy mode.
durationhardinteger
The effect's duration on hard mode.
durationnormalinteger
The effect's duration on normal mode.
effectstring
The identifier of the mob entity to affect.
visibleboolean
Does the entity's look change.
on_fire_timenumber
The amount of time a target will remain on fire.
particle_on_hitobject
The particles that spawn on hit. See the table below for all particle_on_hit parameters.
particle_on_hit
num_particlesnumber
The number of particles to spawn.
on_entity_hitboolean
If true, spawns particles on an entity hit.
on_other_hitboolean
If true, spawns particles on any other hit.
particle_typestring
The id of the particle to spawn on hit.
potion_effectinteger
Defines the effect the arrow will apply to the entity it hits.
remove_on_hitobject
Removes the projectile.
remove_on_hit
spawn_aoe_cloudobject
Potion spawns an area of effect cloud. See the table below for all spawn_aoe_cloud parameters.
spawn_aoe_cloud
affect_ownerboolean
Determines if the projectile shooter is affected.
colorvector_of_3_items
Particle color defined by three rgb values.
durationinteger
How long the particle emits.
particlestring
The particle emitter.
potioninteger
The id of the potion.
radiusnumber
Defines the affected area.
radius_on_usenumber
Defines the affected area when potion is used.
reapplication_delayinteger
Delay before the potion can affect the area again.
spawn_chanceobject
Contains information on the chance of spawning an entity on hit. See parameters below.
spawn_chance
first_spawn_countinteger
The amount of new entities spawned.
first_spawn_percent_chancenumber
The chance that a spawn occurs when a projectile hits the entity.
first_spawn_chancenumber
The chance that a first spawn occurs when a projectile hits the entity.
second_spawn_chancenumber
The chance that a second spawn occurs when a projectile hits the entity.
second_spawn_countinteger
The amount of new entities spawned in teh second spawn.
spawn_babyboolean
Determines if a baby spawns.
spawn_definitionstring
The entity that will spawn.
stick_in_groundobject
Decides if the object sticks in ground and contains shake_time integer parameter to determine how long it will shake.
stick_in_ground
teleport_ownerboolean
Determines if the owner is transported on hit.
thrown_potion_effectobject
Creates a splash area for effects caused by a thrown potion.
thrown_potion_effect
particlestring
Particle to use upon collision.
potion_effectinteger
Defines the effect the arrow will apply to the entity it hits.
powernumber
Determines the velocity of the projectile.
reflect_on_hurtboolean
If true, this entity will be reflected back when hit.
semi_random_diff_damageboolean
If true, damage will be randomized based on damage and speed.
shoot_soundsound_event
The sound that plays when the projectile is shot.
shoot_targetboolean
If true, the projectile will be shot towards the target of the entity firing it.
should_bounceboolean
If true, the projectile will bounce upon hit.
splash_potionboolean
If true, the projectile will be treated like a splash potion.
splash_rangenumber
Radius in blocks of the 'splash' effect.
stop_on_hurtboolean
Determines if the projectile stops when the target is hurt.
uncertainty_basenumber
The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier.
uncertainty_multipliernumber
Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier.