接口 AbstractArrow

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

public interface AbstractArrow extends Projectile
代表一支箭.

原文: Represents an arrow.

  • 方法详细资料

    • getKnockbackStrength

      @Deprecated(since="1.21") int getKnockbackStrength()
      已过时。
      发射武器的功能
      获得此箭的击退强度, 由射出此箭的弓箭 KnockBack 等级定义.

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

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

      @Deprecated(since="1.21") void setKnockbackStrength(int knockbackStrength)
      已过时。
      发射武器的功能
      设定箭的击退强度.

      原文: 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)
      Sets the number of times this arrow can pierce through an entity. Must be between 0 and 127 times.
      参数:
      pierceLevel - new pierce level
    • 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 if it is critical
    • setCritical

      void setCritical(boolean critical)
      Sets whether or not this arrow should be critical.
      参数:
      critical - whether or not it should be 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 if in a block
    • getAttachedBlock

      @Nullable @Nullable Block getAttachedBlock()
      Gets the block to which this arrow is attached.
      返回:
      the attached block or null if not attached
    • getPickupStatus

      Gets the current pickup status of this arrow.
      返回:
      the pickup status of this arrow.
    • setPickupStatus

      void setPickupStatus(@NotNull @NotNull AbstractArrow.PickupStatus status)
      Sets the current pickup status of this arrow.
      参数:
      status - new pickup status of this arrow.
    • isShotFromCrossbow

      boolean isShotFromCrossbow()
      获得此箭是否由弩射出.

      原文: Gets if this arrow was shot from a crossbow.

      返回:
      如果由弩射出则返回true
    • setShotFromCrossbow

      @Deprecated(since="1.21") void setShotFromCrossbow(boolean shotFromCrossbow)
      已过时。
      改用发射武器的功能
      设置此箭是否由弩射出.

      原文: Sets if this arrow was shot from a crossbow.

      参数:
      shotFromCrossbow - 是否由弩射出
      另请参阅:
    • getItem

      获取此箭被拾起时将获得的 ItemStack.

      原文: Gets the ItemStack which will be picked up from this arrow.

      返回:
      被拾起的 ItemStack
    • setItem

      设置此箭被拾起时将获得的 ItemStack.

      原文: Sets the ItemStack which will be picked up from this arrow.

      参数:
      item - 被拾起时的 ItemStack
    • getWeapon

      获取发射此箭的 ItemStack.

      原文: Gets the ItemStack which fired this arrow.

      返回:
      发射此箭的 ItemStack
    • setWeapon

      @Experimental void setWeapon(@NotNull @NotNull ItemStack item)
      设置发射此箭的 ItemStack.

      原文: Sets the ItemStack which fired this arrow.

      参数:
      item - 发射此箭的 ItemStack