Package org.bukkit.entity

# Interface AbstractArrow

All Superinterfaces:
  `Audience`, `CommandSender`, `Entity`, `HoverEventSource<HoverEvent.ShowEntity>`, `Metadatable`, `Nameable`, `Permissible`, `PersistentDataHolder`, `Pointered`, `Projectile`, `ServerOperator`, `Sound.Emitter`

All Known Subinterfaces:
  `Arrow`, `SpectralArrow`, `TippedArrow`, `Trident`

public interface AbstractArrow extends Projectile
Represents an arrow.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`AbstractArrow.PickupRule`
Deprecated.
`static enum`
`AbstractArrow.PickupStatus`
Represents the pickup status of this arrow.

## Nested classes/interfaces inherited from interface org.bukkit.entity.Entity

`Entity.Spigot`

## Method Summary

Modifier and Type
Method
Description
`@Nullable Block`
`getAttachedBlock()`
Gets the block to which this arrow is attached.
`double`
`getDamage()`
Gets the base amount of damage this arrow will do.
`ItemStack`
`getItemStack()`
Gets the ItemStack for this arrow.
`int`
`getKnockbackStrength()`
Gets the knockback strength for an arrow, which is the `KnockBack` level of the bow that shot it.
`default AbstractArrow.PickupRule`
`getPickupRule()`
Deprecated.
Use `getPickupStatus()` as an upstream compatible replacement for this function
`@NotNull AbstractArrow.PickupStatus`
`getPickupStatus()`
Gets the current pickup status of this arrow.
`int`
`getPierceLevel()`
Gets the number of times this arrow can pierce through an entity.
`boolean`
`hasNoPhysics()`
Gets if this arrow has "noclip".
`boolean`
`isCritical()`
Gets whether this arrow is critical.
`boolean`
`isInBlock()`
Gets whether this arrow is in a block or not.
`boolean`
`isShotFromCrossbow()`
Gets if this arrow was shot from a crossbow.
`void`
`setCritical(boolean critical)`
Sets whether or not this arrow should be critical.
`void`
`setDamage(double damage)`
Sets the base amount of damage this arrow will do.
`void`
`setKnockbackStrength(int knockbackStrength)`
Sets the knockback strength for an arrow.
`void`
`setNoPhysics(boolean noPhysics)`
Sets this arrow to "noclip" status.
`default void`
`setPickupRule(AbstractArrow.PickupRule rule)`
Deprecated.
Use `setPickupStatus(PickupStatus)` with `AbstractArrow.PickupStatus` as an upstream compatible replacement for this function
`void`
`setPickupStatus(@NotNull AbstractArrow.PickupStatus status)`
Sets the current pickup status of this arrow.
`void`
`setPierceLevel(int pierceLevel)`
Sets the number of times this arrow can pierce through an entity.
`void`
`setShotFromCrossbow(boolean shotFromCrossbow)`
Sets if this arrow was shot from a crossbow.

### Methods inherited from interface net.kyori.adventure.audience.Audience

`clearTitle, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound`

### Methods inherited from interface org.bukkit.command.CommandSender

`getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage`

### Methods inherited from interface org.bukkit.entity.Entity

`addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync`

### Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

`asHoverEvent`

### Methods inherited from interface org.bukkit.metadata.Metadatable

`getMetadata, hasMetadata, removeMetadata, setMetadata`

### Methods inherited from interface org.bukkit.Nameable

`customName, customName, getCustomName, setCustomName`

### Methods inherited from interface org.bukkit.permissions.Permissible

`addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachment`

### Methods inherited from interface org.bukkit.persistence.PersistentDataHolder

`getPersistentDataContainer`

### Methods inherited from interface net.kyori.adventure.pointer.Pointered

`get, getOrDefault, getOrDefaultFrom, pointers`

### Methods inherited from interface org.bukkit.entity.Projectile

`doesBounce, getShooter, setBounce, setShooter`

### Methods inherited from interface org.bukkit.permissions.ServerOperator

`isOp, setOp`

## Method Details

### getKnockbackStrength

int getKnockbackStrength()
Gets the knockback strength for an arrow, which is the `KnockBack` level of the bow that shot it.

Returns:
  the knockback strength value

### setKnockbackStrength

void setKnockbackStrength(int knockbackStrength)
Sets the knockback strength for an arrow.

Parameters:
  `knockbackStrength` - the knockback strength value

### getDamage

double getDamage()
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.

Returns:
  base damage amount

### setDamage

void setDamage(double damage)
Sets the base amount of damage this arrow will do.

Parameters:
  `damage` - new damage amount

### getPierceLevel

int getPierceLevel()
Gets the number of times this arrow can pierce through an entity.

Returns:
  pierce level

### setPierceLevel

void setPierceLevel(int pierceLevel)
Sets the number of times this arrow can pierce through an entity. Must be between 0 and 127 times.

Parameters:
  `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.

Returns:
  true if it is critical

### setCritical

void setCritical(boolean critical)
Sets whether or not this arrow should be critical.

Parameters:
  `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.

Returns:
  true if in a block

### getAttachedBlock

@Nullable @Nullable Block getAttachedBlock()
Gets the block to which this arrow is attached.

Returns:
  the attached block or null if not attached

### getPickupStatus

@NotNull @NotNull AbstractArrow.PickupStatus getPickupStatus()
Gets the current pickup status of this arrow.

Returns:
  the pickup status of this arrow.

### setPickupStatus

void setPickupStatus(@NotNull @NotNull AbstractArrow.PickupStatus status)
Sets the current pickup status of this arrow.

Parameters:
  `status` - new pickup status of this arrow.

### isShotFromCrossbow

boolean isShotFromCrossbow()
Gets if this arrow was shot from a crossbow.

Returns:
  if shot from a crossbow

### setShotFromCrossbow

void setShotFromCrossbow(boolean shotFromCrossbow)
Sets if this arrow was shot from a crossbow.

Parameters:
  `shotFromCrossbow` - if shot from a crossbow

### getItemStack

@NotNull ItemStack getItemStack()
Gets the ItemStack for this arrow.

Returns:
  The ItemStack, as if a player picked up the arrow

### setNoPhysics

void setNoPhysics(boolean noPhysics)
Sets this arrow to "noclip" status.

Parameters:
  `noPhysics` - true to set "noclip"

### hasNoPhysics

boolean hasNoPhysics()
Gets if this arrow has "noclip".

Returns:
  true if noclip is active

### getPickupRule

@Deprecated default AbstractArrow.PickupRule getPickupRule()
Deprecated.
Use `getPickupStatus()` as an upstream compatible replacement for this function
Gets the `AbstractArrow.PickupRule` for this arrow.

This is generally `AbstractArrow.PickupRule.ALLOWED` only if the arrow was not fired from a bow with the infinity enchantment.

Returns:
  The pickup rule

### setPickupRule

@Deprecated default void setPickupRule(AbstractArrow.PickupRule rule)
Deprecated.
Use `setPickupStatus(PickupStatus)` with `AbstractArrow.PickupStatus` as an upstream compatible replacement for this function
Set the rule for which players can pickup this arrow as an item.

Parameters:
  `rule` - The pickup rule