Package org.bukkit.entity
Interface Arrow
-
- All Superinterfaces:
AbstractArrow
,CommandSender
,Entity
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,Projectile
,ServerOperator
- All Known Subinterfaces:
TippedArrow
public interface Arrow extends AbstractArrow
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bukkit.entity.AbstractArrow
AbstractArrow.PickupStatus
-
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addCustomEffect(PotionEffect effect, boolean overwrite)
Adds a custom potion effect to this arrow.void
clearCustomEffects()
Removes all custom potion effects from this arrow.PotionData
getBasePotionData()
Returns the potion data about the base potionColor
getColor()
Gets the color of this arrow.List<PotionEffect>
getCustomEffects()
Gets an immutable list containing all custom potion effects applied to this arrow.boolean
hasCustomEffect(PotionEffectType type)
Checks for a specific custom potion effect type on this arrow.boolean
hasCustomEffects()
Checks for the presence of custom potion effects.boolean
removeCustomEffect(PotionEffectType type)
Removes a custom potion effect from this arrow.void
setBasePotionData(PotionData data)
Sets the underlying potion datavoid
setColor(Color color)
Sets the color of this arrow.-
Methods inherited from interface org.bukkit.entity.AbstractArrow
getAttachedBlock, getDamage, getKnockbackStrength, getPickupStatus, getPierceLevel, isCritical, isInBlock, setCritical, setDamage, setKnockbackStrength, setPickupStatus, setPierceLevel
-
Methods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage
-
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, eject, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isPersistent, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport
-
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
Methods inherited from interface org.bukkit.Nameable
getCustomName, setCustomName
-
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
-
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
Methods inherited from interface org.bukkit.entity.Projectile
doesBounce, getShooter, setBounce, setShooter
-
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
-
-
-
Method Detail
-
setBasePotionData
void setBasePotionData(@NotNull PotionData data)
Sets the underlying potion data- Parameters:
data
- PotionData to set the base potion state to
-
getBasePotionData
@NotNull PotionData getBasePotionData()
Returns the potion data about the base potion- Returns:
- a PotionData object
-
getColor
@NotNull Color getColor()
Gets the color of this arrow.- Returns:
- arrow color
-
setColor
void setColor(@NotNull Color color)
Sets the color of this arrow. Will be applied as a tint to its particles.- Parameters:
color
- arrow color
-
hasCustomEffects
boolean hasCustomEffects()
Checks for the presence of custom potion effects.- Returns:
- true if custom potion effects are applied
-
getCustomEffects
@NotNull List<PotionEffect> getCustomEffects()
Gets an immutable list containing all custom potion effects applied to this arrow.Plugins should check that hasCustomEffects() returns true before calling this method.
- Returns:
- the immutable list of custom potion effects
-
addCustomEffect
boolean addCustomEffect(@NotNull PotionEffect effect, boolean overwrite)
Adds a custom potion effect to this arrow.- Parameters:
effect
- the potion effect to addoverwrite
- true if any existing effect of the same type should be overwritten- Returns:
- true if the effect was added as a result of this call
-
removeCustomEffect
boolean removeCustomEffect(@NotNull PotionEffectType type)
Removes a custom potion effect from this arrow.- Parameters:
type
- the potion effect type to remove- Returns:
- true if the an effect was removed as a result of this call
- Throws:
IllegalArgumentException
- if this operation would leave the Arrow in a state with no Custom Effects and PotionType.UNCRAFTABLE
-
hasCustomEffect
boolean hasCustomEffect(@Nullable PotionEffectType type)
Checks for a specific custom potion effect type on this arrow.- Parameters:
type
- the potion effect type to check for- Returns:
- true if the potion has this effect
-
clearCustomEffects
void clearCustomEffects()
Removes all custom potion effects from this arrow.- Throws:
IllegalArgumentException
- if this operation would leave the Arrow in a state with no Custom Effects and PotionType.UNCRAFTABLE
-
-