实验性实验性airThe fraction of the projectile's speed maintained every tick while traveling through air.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性catchIf true, the entity will be set on fire when hurt. The default burn duration is 5 seconds. This duration can be modified via the onFireTime property. The entity will not catch fire if immune or if the entity is wet.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性critIf true, the projectile will spawn crit particles when hit by a player. E.g. Player attacking a Shulker bullet.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性destroyIf true, the projectile will be destroyed when it takes damage. E.g. Player attacking a Shulker bullet.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
只读 实验性entity实验性gravityThe gravity applied to the projectile. When the entity is not on the ground, subtracts this amount from the projectile’s change in vertical position every tick. The higher the value, the faster the projectile falls. If negative, the entity will rise instead of fall.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
可选 实验性hit可选 实验性hit可选 实验性hit只读 实验性is实验性lightningIf true and the weather is thunder and the entity has line of sight to the sky, the entity will be struck by lightning when hit. E.g. A thrown Trident with the Channeling enchantment.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性liquidThe fraction of the projectile's speed maintained every tick while traveling through a liquid.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性onDuration in seconds that the entity hit will be on fire for when catchFireOnHurt is set to true.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
可选 实验性ownerThe owner of the projectile. This is used to determine what the projectile can collide with and damage. It also determines which entity is assigned as the attacker.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性shouldIf true, the projectile will bounce off mobs when no damage is taken. E.g. A spawning wither.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性stopIf true, the projectile will stop moving when an entity is hit as thought it had been blocked. E.g. Thrown trident on hit behavior.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
只读 实验性type静态 只读 实验性component实验性The velocity to fire the projectile. This controls both the speed and direction which which the projectile will be shot.
可选options: ProjectileShootOptionsOptional configuration for the shoot.
Shoots the projectile with a given velocity. The projectile will be shot from its current location.
无法在只读模式下调用此函数,详见 WorldBeforeEvents。
The projectile component controls the properties of a projectile entity and allows it to be shot in a given direction. This component is present when the entity has the minecraft:projectile component.
示例: shootArrow.ts