Interface Firework

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

public interface Firework extends Projectile
  • Method Details

    • getFireworkMeta

      @NotNull @NotNull FireworkMeta getFireworkMeta()
      Get a copy of the fireworks meta
      Returns:
      A copy of the current Firework meta
    • setFireworkMeta

      void setFireworkMeta(@NotNull @NotNull FireworkMeta meta)
      Apply the provided meta to the fireworks

      Adjusts 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

      @Nullable UUID getSpawningEntity()
    • getBoostedEntity

      @Nullable @Nullable LivingEntity getBoostedEntity()
      If this firework is boosting an entity, return it
      Returns:
      The entity being boosted
    • getItem

      @NotNull ItemStack getItem()
      Gets the item used in the firework.
      Returns:
      firework item
    • setItem

      void setItem(@Nullable ItemStack itemStack)
      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