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 Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot -
Method Summary
Modifier and TypeMethodDescriptionvoiddetonate()Cause this firework to explode at earliest opportunity, as if it has no remaining fuse.If this firework is boosting an entity, return itGet a copy of the fireworks metagetItem()Gets the item used in the firework.intGets the number of ticks the firework has flown.intGets the number of ticks the firework will detonate on.booleanGets if the firework was shot at an angle (i.e.voidApply the provided meta to the fireworksvoidSets the item used in the firework.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.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, stopSoundMethods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessageMethods 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, teleport, teleport, teleport, teleport, teleportAsync, teleportAsyncMethods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEventMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.entity.Projectile
doesBounce, getShooter, setBounce, setShooterMethods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
getFireworkMeta
Get a copy of the fireworks meta- Returns:
- A copy of the current Firework meta
-
setFireworkMeta
Apply the provided meta to the fireworksAdjusts detonation ticks automatically.
- Parameters:
meta- The FireworkMeta to apply
-
detonate
void detonate()Cause this firework to explode at earliest opportunity, as if it has no remaining fuse. -
isShotAtAngle
boolean 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
-
setShotAtAngle
void 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
-
getBoostedEntity
If this firework is boosting an entity, return it- Returns:
- The entity being boosted
-
getItem
Gets the item used in the firework.- Returns:
- firework item
-
setItem
Sets the item used in the firework.Firework explosion effects are used from this item.
- Parameters:
itemStack- item to set
-
getTicksFlown
int getTicksFlown()Gets the number of ticks the firework has flown.- Returns:
- ticks flown
-
setTicksFlown
void 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
-
getTicksToDetonate
int getTicksToDetonate()Gets the number of ticks the firework will detonate on.- Returns:
- the tick to detonate on
-
setTicksToDetonate
void setTicksToDetonate(int ticks) Set the amount of ticks the firework will detonate on.- Parameters:
ticks- ticks to detonate on
-