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
Represents an arrow.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumDeprecated.static enumRepresents the pickup status of this arrow.Nested classes/interfaces inherited from interface org.bukkit.entity.EntityEntity.Spigot
- 
Method SummaryModifier and TypeMethodDescriptionGets the block to which this arrow is attached.doubleGets the base amount of damage this arrow will do.Gets the sound that is played when this arrow hits an entity.Gets the ItemStack for this arrow.intGets the knockback strength for an arrow, which is theKnockBacklevel of the bow that shot it.intGets how many ticks this arrow has been in the world for.default AbstractArrow.PickupRuleDeprecated.Gets the current pickup status of this arrow.intGets the number of times this arrow can pierce through an entity.booleanGets if this arrow has "noclip".booleanGets whether this arrow is critical.booleanGets whether this arrow is in a block or not.booleanGets if this arrow was shot from a crossbow.voidsetCritical(boolean critical) Sets whether or not this arrow should be critical.voidsetDamage(double damage) Sets the base amount of damage this arrow will do.voidsetHitSound(Sound sound) Sets the sound that is played when this arrow hits an entity.voidsetKnockbackStrength(int knockbackStrength) Sets the knockback strength for an arrow.voidsetLifetimeTicks(int ticks) Sets the amount of ticks this arrow has been alive in the world This is used to determine when the arrow should be automatically despawned.voidsetNoPhysics(boolean noPhysics) Sets this arrow to "noclip" status.default voidDeprecated.UsesetPickupStatus(PickupStatus)withAbstractArrow.PickupStatusas an upstream compatible replacement for this functionvoidSets the current pickup status of this arrow.voidsetPierceLevel(int pierceLevel) Sets the number of times this arrow can pierce through an entity.voidsetShotFromCrossbow(boolean shotFromCrossbow) Sets if this arrow was shot from a crossbow.Methods inherited from interface net.kyori.adventure.audience.AudienceclearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSoundMethods inherited from interface org.bukkit.command.CommandSendergetName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessageMethods inherited from interface org.bukkit.entity.EntityaddPassenger, addScoreboardTag, asHoverEvent, collidesAt, 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, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, 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, isSneaking, isTicking, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, wouldCollideUsingMethods inherited from interface net.kyori.adventure.text.event.HoverEventSourceasHoverEventMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablecustomName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.entity.ProjectilecanHitEntity, doesBounce, getOwnerUniqueId, getShooter, hasBeenShot, hasLeftShooter, hitEntity, hitEntity, setBounce, setHasBeenShot, setHasLeftShooter, setShooterMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
getKnockbackStrengthint getKnockbackStrength()Gets the knockback strength for an arrow, which is theKnockBacklevel of the bow that shot it.- Returns:
- the knockback strength value
 
- 
setKnockbackStrengthvoid setKnockbackStrength(int knockbackStrength) Sets the knockback strength for an arrow.- Parameters:
- knockbackStrength- the knockback strength value
 
- 
getDamagedouble getDamage()Gets the base amount of damage this arrow will do. Defaults to 2.0 for a normal arrow with0.5 * (1 + power level)added for arrows fired from enchanted bows.- Returns:
- base damage amount
 
- 
setDamagevoid setDamage(double damage) Sets the base amount of damage this arrow will do.- Parameters:
- damage- new damage amount
 
- 
getPierceLevelint getPierceLevel()Gets the number of times this arrow can pierce through an entity.- Returns:
- pierce level
 
- 
setPierceLevelvoid 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
 
- 
isCriticalboolean 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
 
- 
setCriticalvoid setCritical(boolean critical) Sets whether or not this arrow should be critical.- Parameters:
- critical- whether or not it should be critical
 
- 
isInBlockboolean 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
 
- 
getAttachedBlockGets the block to which this arrow is attached.- Returns:
- the attached block or null if not attached
 
- 
getPickupStatusGets the current pickup status of this arrow.- Returns:
- the pickup status of this arrow.
 
- 
setPickupStatusSets the current pickup status of this arrow.- Parameters:
- status- new pickup status of this arrow.
 
- 
isShotFromCrossbowboolean isShotFromCrossbow()Gets if this arrow was shot from a crossbow.- Returns:
- if shot from a crossbow
 
- 
setShotFromCrossbowvoid setShotFromCrossbow(boolean shotFromCrossbow) Sets if this arrow was shot from a crossbow.- Parameters:
- shotFromCrossbow- if shot from a crossbow
 
- 
getItemStackGets the ItemStack for this arrow.- Returns:
- The ItemStack, as if a player picked up the arrow
 
- 
setLifetimeTicksvoid setLifetimeTicks(int ticks) Sets the amount of ticks this arrow has been alive in the world This is used to determine when the arrow should be automatically despawned.- Parameters:
- ticks- lifetime ticks
 
- 
getLifetimeTicksint getLifetimeTicks()Gets how many ticks this arrow has been in the world for.- Returns:
- ticks this arrow has been in the world
 
- 
getHitSoundGets the sound that is played when this arrow hits an entity.- Returns:
- sound that plays
 
- 
setHitSoundSets the sound that is played when this arrow hits an entity.- Parameters:
- sound- sound that is played
 
- 
setNoPhysicsvoid setNoPhysics(boolean noPhysics) Sets this arrow to "noclip" status.- Parameters:
- noPhysics- true to set "noclip"
 
- 
hasNoPhysicsboolean hasNoPhysics()Gets if this arrow has "noclip".- Returns:
- true if noclip is active
 
- 
getPickupRuleDeprecated.UsegetPickupStatus()as an upstream compatible replacement for this functionGets theAbstractArrow.PickupRulefor this arrow.This is generally AbstractArrow.PickupRule.ALLOWEDonly if the arrow was not fired from a bow with the infinity enchantment.- Returns:
- The pickup rule
 
- 
setPickupRuleDeprecated.UsesetPickupStatus(PickupStatus)withAbstractArrow.PickupStatusas an upstream compatible replacement for this functionSet the rule for which players can pickup this arrow as an item.- Parameters:
- rule- The pickup rule
 
 
- 
getPickupStatus()as an upstream compatible replacement for this function