Projectile¶
文档版本:1.21.50.25
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
boolean "hit_nearest_passenger" : opt
array "ignored_entities" : opt
{
string "<any array element>" : 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
effect "effect"
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
number "reflect_immunity" : 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
}
anchor
:integer- 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_offset
:number- 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_fire
:boolean- If true, the entity hit will be set on fire.
crit_particle_on_hurt
:boolean- If true, when a projectile deals damage, whether or not to spawn in the critical damage particles.
destroy_on_hurt
:boolean- When this projectile deals damage, whether or not to immediately destroy this projectile.
filter
:string- Entity Definitions defined here can't be hurt by the projectile.
fire_affected_by_griefing
:boolean- If true, whether the projectile causes fire is affected by the mob griefing game rule.
gravity
:number- 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_nearest_passenger
:boolean- If true, when hitting a vehicle, and there's at least one passenger in the vehicle, the damage will be dealt to the passenger closest to the projectile impact point. If there are no passengers, this setting does nothing.
ignored_entities
:array- [EXPERIMENTAL] An array of strings defining the types of entities that this entity does not collide with.
ignored_entities
<any array element>
:string
hit_ground_sound
:sound_event- The sound that plays when the projectile hits the ground.
hit_sound
:sound_event- The sound that plays when the projectile hits something.
homing
:boolean- If true, the projectile homes in to the nearest entity.
inertia
:number- The fraction of the projectile's speed maintained every frame while traveling in air.
is_dangerous
:boolean- If true, the projectile will be treated as dangerous to the players.
knockback
:boolean- If true, the projectile will knock back the entity it hits.
lightning
:boolean- If true, the entity hit will be struck by lightning.
liquid_inertia
:number- The fraction of the projectile's speed maintained every frame while traveling in water.
multiple_targets
:boolean- If true, the projectile can hit multiple entities per flight.
mob_effect
- SEE on_hit/mob_effect.
offset
:vector_of_3_items- The offset from the entity's anchor where the projectile will spawn.
0..0
:number- The X component.
1..1
:number- The Y component.
2..2
:number- The Z component.
on_fire_time
:number- Time in seconds that the entity hit will be on fire for.
on_hit
:object- 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_effect
:object- The target receives a mob effect. See the table below for all arrow_effect parameters.
arrow_effect
apply_effect_to_blocking_targets
:boolean- If true, the effect will be applied to blocking targets.
catch_fire
:boolean- Determines if the struck object is set on fire.
definition_event
:object- The event that is triggered on a hit. See the table below for all definition event parameters.
definition_event
affect_projectile
:boolean- The projectile that will be affected by this event.
affect_shooter
:boolean- The shooter that will be affected by this event.
affect_splash_area
:boolean- All entities in the splash area will be affected by this event.
affect_target
:boolean- The target will be affected by this event.
event_trigger
:event- The event triggered. Also has an option filters parameter to limit affected targets.
event
:string- The event to fire.
target
:string- The target of the event.
splash_area
:number- The splash area that will be affected.
douse_fire
:boolean- If the target is on fire, then douse the fire.
freeze_on_hit
:object- 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
shape
:string- The shape of the area that is frozen.
snap_to_block
:boolean- If true, the area will snap to the nearest block.
size
:number- The size of the area that is frozen.
grant_xp
:object- Grants XP on hit. Has minXP for minimum XP granted, maxXp for maximum, or simply flat xp properties.
grant_xp
minXP
:number- The minimum XP granted.
maxXP
:number- The maximum XP granted.
hurt_owner
:object- Determines if the owner of the entity is hurt on hit. Contains decimal owner_damage, knockback boolean, and ignite boolean.
hurt_owner
owner_damage
:number- The amount of damage the owner will take.
knockback
:boolean- If true, the owner will be knocked back.
ignite
:boolean- If true, the owner will be set on fire.
ignite
:boolean- Determines if a fire may be started on a flammable target.
impact_damage
:object- 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_fire
:boolean- Determines if the struck object is set on fire.
channeling
:boolean- Whether lightning can be channeled through hte weapon.
damage
:number- The damage dealt on impact.
damage
:array- The damage dealt on impact.
damage
0..0
:number
1..1
:number
destroy_on_hit
:boolean- Projectile is removed on hit.
destroy_on_hit_requires_damage
:boolean- If true, then the hit must cause damage to destroy the projectile.
filter
:string- The identifier of an entity that can be hit.
knockback
:boolean- If true, the projectile will knock back the entity it hits.
max_critical_damage
:integer- Maximum critical damage.
min_critical_damage
:integer- Minimum critical damage.
power_multiplier
:number- How much the base damage is multiplied.
semi_random_diff_damage
:boolean- If true, damage will be randomized based on damage and speed.
set_last_hurt_requires_damage
:boolean- If true, then the hit must cause damage to update the last hurt property.
should_bounce
:boolean- If true, the projectile will bounce
mob_effect
:object- The target receives a mob effect. See the table below for all mob_effect parameters.
mob_effect
ambient
:boolean- If true, a mob will spawn that is not hostile, like the bat entity in Minecraft.
amplifier
:integer- The multiplier of the amplification of this effect.
duration
:integer- The effect's duration.
durationeasy
:integer- The effect's duration on easy mode.
durationhard
:integer- The effect's duration on hard mode.
durationnormal
:integer- The effect's duration on normal mode.
effect
:effect- The identifier of the mob entity to affect.
visible
:boolean- Does the entity's look change.
on_fire_time
:number- The amount of time a target will remain on fire.
particle_on_hit
:object- The particles that spawn on hit. See the table below for all particle_on_hit parameters.
particle_on_hit
num_particles
:number- The number of particles to spawn.
on_entity_hit
:boolean- If true, spawns particles on an entity hit.
on_other_hit
:boolean- If true, spawns particles on any other hit.
particle_type
:string- The id of the particle to spawn on hit.
potion_effect
:integer- Defines the effect the arrow will apply to the entity it hits.
remove_on_hit
:object- Removes the projectile.
remove_on_hit
spawn_aoe_cloud
:object- Potion spawns an area of effect cloud. See the table below for all spawn_aoe_cloud parameters.
spawn_aoe_cloud
affect_owner
:boolean- Determines if the projectile shooter is affected.
color
:vector_of_3_items- Particle color defined by three rgb values.
duration
:integer- How long the particle emits.
particle
:string- The particle emitter.
potion
:integer- The id of the potion.
radius
:number- Defines the affected area.
radius_on_use
:number- Defines the affected area when potion is used.
reapplication_delay
:integer- Delay before the potion can affect the area again.
spawn_chance
:object- Contains information on the chance of spawning an entity on hit. See parameters below.
spawn_chance
first_spawn_count
:integer- The amount of new entities spawned.
first_spawn_percent_chance
:number- The chance that a spawn occurs when a projectile hits the entity.
first_spawn_chance
:number- The chance that a first spawn occurs when a projectile hits the entity.
second_spawn_chance
:number- The chance that a second spawn occurs when a projectile hits the entity.
second_spawn_count
:integer- The amount of new entities spawned in teh second spawn.
spawn_baby
:boolean- Determines if a baby spawns.
spawn_definition
:string- The entity that will spawn.
stick_in_ground
:object- Decides if the object sticks in ground and contains shake_time integer parameter to determine how long it will shake.
stick_in_ground
teleport_owner
:boolean- Determines if the owner is transported on hit.
thrown_potion_effect
:object- Creates a splash area for effects caused by a thrown potion.
thrown_potion_effect
particle
:string- Particle to use upon collision.
potion_effect
:integer- Defines the effect the arrow will apply to the entity it hits.
power
:number- Determines the velocity of the projectile.
reflect_immunity
:number- During the specified time, in seconds, the projectile cannot be reflected by hitting it
reflect_on_hurt
:boolean- If true, this entity will be reflected back when hit.
semi_random_diff_damage
:boolean- If true, damage will be randomized based on damage and speed.
shoot_sound
:sound_event- The sound that plays when the projectile is shot.
shoot_target
:boolean- If true, the projectile will be shot towards the target of the entity firing it.
should_bounce
:boolean- If true, the projectile will bounce upon hit.
splash_potion
:boolean- If true, the projectile will be treated like a splash potion.
splash_range
:number- Radius in blocks of the 'splash' effect.
stop_on_hurt
:boolean- Determines if the projectile stops when the target is hurt.
uncertainty_base
:number- The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier.
uncertainty_multiplier
:number- Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier.