Package org.bukkit.entity
Interface Firework
- All Superinterfaces:
- Audience,- CommandSender,- Entity,- HoverEventSource<HoverEvent.ShowEntity>,- Metadatable,- Nameable,- Permissible,- PersistentDataHolder,- Pointered,- Projectile,- ServerOperator,- Sound.Emitter
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.bukkit.entity.EntityEntity.Spigot
- 
Method SummaryModifier and TypeMethodDescriptionvoiddetonate()Cause this firework to explode at earliest opportunity, as if it has no remaining fuse.Get theLivingEntityto which this firework is attached.default @Nullable LivingEntityDeprecated.Get a copy of the fireworks metagetItem()Gets the item used in the firework.intgetLife()Deprecated, for removal: This API element is subject to removal in a future version.usegetTicksFlown()intDeprecated, for removal: This API element is subject to removal in a future version.intGets the number of ticks the firework has flown.intGets the number of ticks the firework will detonate on.booleanCheck whether or not this firework has detonated.booleanGets if the firework was shot at an angle (i.e.booleansetAttachedTo(@Nullable LivingEntity entity) Set theLivingEntityto which this firework is attached.voidApply the provided meta to the fireworksvoidSets the item used in the firework.booleansetLife(int ticks) Deprecated, for removal: This API element is subject to removal in a future version.booleansetMaxLife(int ticks) Deprecated, for removal: This API element is subject to removal in a future version.voidsetShotAtAngle(boolean shotAtAngle) Sets if the firework was shot at an angle (i.e.voidsetTicksFlown(int ticks) Sets the number of ticks the firework has flown.voidsetTicksToDetonate(int ticks) Set the amount of ticks the firework will detonate on.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, sendRichMessage, 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, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, 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, setPose, setPose, 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- 
getFireworkMetaGet a copy of the fireworks meta- Returns:
- A copy of the current Firework meta
 
- 
setFireworkMetaApply the provided meta to the fireworksAdjusts detonation ticks automatically. - Parameters:
- meta- The FireworkMeta to apply
 
- 
setAttachedToSet theLivingEntityto which this firework is attached.When attached to an entity, the firework effect will act as normal but remain positioned on the entity. If the entity LivingEntity#isGliding() is gliding, then the entity will receive a boost in the direction that they are looking.- Parameters:
- entity- the entity to which the firework should be attached, or null to remove the attached entity
- Returns:
- true if the entity could be attached, false if the firework was already detonated
 
- 
getAttachedToGet theLivingEntityto which this firework is attached.When attached to an entity, the firework effect will act as normal but remain positioned on the entity. If the entity LivingEntity#isGliding() is gliding, then the entity will receive a boost in the direction that they are looking.- Returns:
- the attached entity, or null if none
 
- 
setLifeDeprecated, for removal: This API element is subject to removal in a future version.Set the ticks that this firework has been alive. If this value exceedsgetMaxLife(), the firework will detonate.- Parameters:
- ticks- the ticks to set. Must be greater than or equal to 0
- Returns:
- true if the life was set, false if this firework has already detonated
 
- 
getLifeDeprecated, for removal: This API element is subject to removal in a future version.usegetTicksFlown()Get the ticks that this firework has been alive. When this value reachesgetMaxLife(), the firework will detonate.- Returns:
- the life ticks
 
- 
setMaxLifeDeprecated, for removal: This API element is subject to removal in a future version.Set the time in ticks this firework will exist until it is detonated.- Parameters:
- ticks- the ticks to set. Must be greater than 0
- Returns:
- true if the time was set, false if this firework has already detonated
 
- 
getMaxLifeDeprecated, for removal: This API element is subject to removal in a future version.Get the time in ticks this firework will exist until it is detonated.- Returns:
- the maximum life in ticks
 
- 
detonatevoid detonate()Cause this firework to explode at earliest opportunity, as if it has no remaining fuse.
- 
isDetonatedboolean isDetonated()Check whether or not this firework has detonated.- Returns:
- true if detonated, false if still in the world
 
- 
isShotAtAngleboolean isShotAtAngle()Gets if the firework was shot at an angle (i.e. from a crossbow). A firework which was not shot at an angle will fly straight upwards.- Returns:
- shot at angle status
 
- 
setShotAtAnglevoid setShotAtAngle(boolean shotAtAngle) Sets if the firework was shot at an angle (i.e. from a crossbow). A firework which was not shot at an angle will fly straight upwards.- Parameters:
- shotAtAngle- the new shotAtAngle
 
- 
getSpawningEntity
- 
getBoostedEntityDeprecated.usegetAttachedTo()If this firework is boosting an entity, return it- Returns:
- The entity being boosted
- See Also:
 
- 
getItemGets the item used in the firework.- Returns:
- firework item
 
- 
setItemSets the item used in the firework.Firework explosion effects are used from this item. - Parameters:
- itemStack- item to set
 
- 
getTicksFlownint getTicksFlown()Gets the number of ticks the firework has flown.- Returns:
- ticks flown
 
- 
setTicksFlownvoid setTicksFlown(int ticks) Sets the number of ticks the firework has flown. Setting this greater than detonation ticks will cause the firework to explode.- Parameters:
- ticks- ticks flown
 
- 
getTicksToDetonateint getTicksToDetonate()Gets the number of ticks the firework will detonate on.- Returns:
- the tick to detonate on
 
- 
setTicksToDetonatevoid setTicksToDetonate(int ticks) Set the amount of ticks the firework will detonate on.- Parameters:
- ticks- ticks to detonate on
 
 
- 
getAttachedTo()