跳转至

Shooter

文档版本:1.21.0.24

Defines the entity's ranged attack behavior.

架构

shooter:
{
  integer "aux_val" : opt
  string "def" : opt
  boolean "magic" : opt
  number "power" : opt
  array "projectiles" : opt
  {
    string "<any array element>" : opt
    object "<any array element>" : opt
    {
      integer "aux_val" : opt
      string "def" : opt
      filters "filters"
    }
  }
  string "sound" : opt
}
aux_valinteger
ID of the Potion effect to be applied on hit.
defstring
Actor definition to use as projectile for the ranged attack. The actor definition must have the projectile component to be able to be shot as a projectile
magicboolean
Sets whether the projectiles being used are flagged as magic. If set, the ranged attack goal will not be used at the same time as other magic goals, such as minecraft:behavior.drink_potion.
powernumber
Velocity in which the projectiles will be shot. A power of 0 will be overwritten by the default projectile throw power.
projectilesarray
List of projectiles that can be used by the shooter. Projectiles are evaluated in the order of the list; after a projectile is chosen, the rest of the list is ignored.
projectiles
<any array element>string
Projectiles that can be used by the shooter
<any array element>object
A projectile defintion
<any array element>
aux_valinteger
ID of the Potion effect to be applied on hit.
defstring
Actor definition to use as projectile for the ranged attack. The actor definition must have the projectile component to be able to be shot as a projectile
filtersfilters
一个过滤器组
soundstring
Sound that is played when the shooter shoots a projectile.