接口 AbstractArrow

所有超级接口:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, Projectile, ServerOperator
所有已知子接口:
Arrow, SpectralArrow, TippedArrow, Trident

public interface AbstractArrow extends Projectile
代表一支箭.

原文: Represents an arrow.

  • 方法详细资料

    • getKnockbackStrength

      @Deprecated int getKnockbackStrength()
      已过时。
      a function of the firing weapon
      获得此箭的击退强度, 由射出此箭的弓箭 KnockBack 等级定义.

      原文: Gets the knockback strength for an arrow, which is the KnockBack level of the bow that shot it.

      返回:
      击退强度值
      另请参阅:
    • setKnockbackStrength

      @Deprecated void setKnockbackStrength(int knockbackStrength)
      已过时。
      a function of the firing weapon
      设定箭的击退强度.

      原文: Sets the knockback strength for an arrow.

      参数:
      knockbackStrength - 击退强度值
      另请参阅:
    • getDamage

      double getDamage()
      获得此箭将造成的基本伤害值. 普通箭默认为2.0, 附魔弓加成额外的伤害0.5 * (1 + 力量附魔等级 )

      原文: Gets the base amount of damage this arrow will do. Defaults to 2.0 for a normal arrow with 0.5 * (1 + power level) added for arrows fired from enchanted bows.

      返回:
      基本伤害值
    • setDamage

      void setDamage(double damage)
      设置此箭将造成的基本伤害值.

      原文: Sets the base amount of damage this arrow will do.

      参数:
      damage - 新的伤害值
    • getPierceLevel

      int getPierceLevel()
      获得此箭能够穿透实体的次数.

      原文: Gets the number of times this arrow can pierce through an entity.

      返回:
      穿透等级
    • setPierceLevel

      void setPierceLevel(int pierceLevel)
      设置此箭能够穿透实体的次数. 必须在 0 至 127 次之间.

      原文: Sets the number of times this arrow can pierce through an entity. Must be between 0 and 127 times.

      参数:
      pierceLevel - 新的穿透等级
    • isCritical

      boolean isCritical()
      获得此箭是否能造成暴击.

      暴击箭将会增加伤害并产生粒子效果.

      暴击箭一般是发生在玩家将弓箭完全蓄力后发射.

      原文: Gets whether this arrow is critical.

      Critical arrows have increased damage and cause particle effects.

      Critical arrows generally occur when a player fully draws a bow before firing.

      返回:
      暴击返回true
    • setCritical

      void setCritical(boolean critical)
      设置此箭是否暴击.

      原文: Sets whether or not this arrow should be critical.

      参数:
      critical - 是否暴击
    • isInBlock

      boolean isInBlock()
      获得此箭是否在一个方块上.

      在方块上的箭将静止, 且可能能被玩家拾起.

      原文: Gets whether this arrow is in a block or not.

      Arrows in a block are motionless and may be picked up by players.

      返回:
      如果在方块上返回true
    • getAttachedBlock

      @Nullable @Nullable Block getAttachedBlock()
      获得这支箭连接的方块. 译注:箭插在方块上, 这个方块就是箭连接的方块.

      原文: Gets the block to which this arrow is attached.

      返回:
      返回所连接的方块, 否则返回null
    • getPickupStatus

      获得此箭的拾起状态.

      原文: Gets the current pickup status of this arrow.

      返回:
      这只箭的拾起状态.
    • setPickupStatus

      void setPickupStatus(@NotNull @NotNull AbstractArrow.PickupStatus status)
      设置此箭的拾起状态.

      原文: Sets the current pickup status of this arrow.

      参数:
      status - 新的拾起状态.
    • isShotFromCrossbow

      boolean isShotFromCrossbow()
      Gets if this arrow was shot from a crossbow.
      返回:
      if shot from a crossbow
    • setShotFromCrossbow

      @Deprecated void setShotFromCrossbow(boolean shotFromCrossbow)
      已过时。
      a function of the firing weapon instead
      Sets if this arrow was shot from a crossbow.
      参数:
      shotFromCrossbow - if shot from a crossbow
      另请参阅:
    • getItem

      Gets the ItemStack which will be picked up from this arrow.
      返回:
      The picked up ItemStack
    • setItem

      Sets the ItemStack which will be picked up from this arrow.
      参数:
      item - ItemStack set to be picked up
    • getWeapon

      Gets the ItemStack which fired this arrow.
      返回:
      The firing ItemStack
    • setWeapon

      @Experimental void setWeapon(@NotNull @NotNull ItemStack item)
      Sets the ItemStack which fired this arrow.
      参数:
      item - The firing ItemStack