程序包 org.bukkit.entity

# 接口 Firework

所有超级接口:
  `CommandSender`, `Entity`, `Metadatable`, `Nameable`, `Permissible`, `PersistentDataHolder`, `Projectile`, `ServerOperator`

public interface Firework extends Projectile
烟花火箭实体.

- ## 嵌套类概要

  ## 从接口继承的嵌套类/接口 org.bukkit.entity.Entity

  `Entity.Spigot`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `void`
  `detonate()`
  使烟花尽早爆炸, 像是它的引火线已燃烧殆尽.
  `@Nullable LivingEntity`
  `getAttachedTo()`
  Get the `LivingEntity` to which this firework is attached.
  `@NotNull FireworkMeta`
  `getFireworkMeta()`
  获取烟花火箭元数据的副本.
  `int`
  `getLife()`
  Get the ticks that this firework has been alive.
  `int`
  `getMaxLife()`
  Get the time in ticks this firework will exist until it is detonated.
  `boolean`
  `isDetonated()`
  Check whether or not this firework has detonated.
  `boolean`
  `isShotAtAngle()`
  获取此烟花是否以一定角度发射 (比如使用弩).
  `boolean`
  `setAttachedTo(@Nullable LivingEntity entity)`
  Set the `LivingEntity` to which this firework is attached.
  `void`
  `setFireworkMeta(@NotNull FireworkMeta meta)`
  为此烟花火箭应用提供的烟花火箭元数据.
  `boolean`
  `setLife(int ticks)`
  Set the ticks that this firework has been alive.
  `boolean`
  `setMaxLife(int ticks)`
  Set the time in ticks this firework will exist until it is detonated.
  `void`
  `setShotAtAngle(boolean shotAtAngle)`
  设置此烟花是否以一定角度发射 (比如使用弩).

  ### 从接口继承的方法 org.bukkit.command.CommandSender

  `getName, sendMessage, sendMessage, sendMessage, sendMessage`

  ### 从接口继承的方法 org.bukkit.entity.Entity

  `addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport`

  ### 从接口继承的方法 org.bukkit.metadata.Metadatable

  `getMetadata, hasMetadata, removeMetadata, setMetadata`

  ### 从接口继承的方法 org.bukkit.Nameable

  `getCustomName, setCustomName`

  ### 从接口继承的方法 org.bukkit.permissions.Permissible

  `addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment`

  ### 从接口继承的方法 org.bukkit.persistence.PersistentDataHolder

  `getPersistentDataContainer`

  ### 从接口继承的方法 org.bukkit.entity.Projectile

  `doesBounce, getShooter, setBounce, setShooter`

  ### 从接口继承的方法 org.bukkit.permissions.ServerOperator

  `isOp, setOp`

- ## 方法详细资料

  - ### getFireworkMeta

    @NotNull @NotNull FireworkMeta getFireworkMeta()
    获取烟花火箭元数据的副本.

    原文:Get a copy of the fireworks meta

    返回:
      烟花火箭元数据的副本

  - ### setFireworkMeta

    void setFireworkMeta(@NotNull @NotNull FireworkMeta meta)
    为此烟花火箭应用提供的烟花火箭元数据.

    原文:Apply the provided meta to the fireworks

    参数:
      `meta` - 要应用的 FireworkMeta

  - ### setAttachedTo

    boolean setAttachedTo(@Nullable @Nullable LivingEntity entity)
    Set the `LivingEntity` to 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.

    参数:
      `entity` - the entity to which the firework should be attached, or null to remove the attached entity
    返回:
      true if the entity could be attached, false if the firework was already detonated

  - ### getAttachedTo

    @Nullable @Nullable LivingEntity getAttachedTo()
    Get the `LivingEntity` to 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.

    返回:
      the attached entity, or null if none

  - ### setLife

    boolean setLife(int ticks)
    Set the ticks that this firework has been alive. If this value exceeds `getMaxLife()`, the firework will detonate.
    参数:
      `ticks` - the ticks to set. Must be greater than or equal to 0
    返回:
      true if the life was set, false if this firework has already detonated

  - ### getLife

    int getLife()
    Get the ticks that this firework has been alive. When this value reaches `getMaxLife()`, the firework will detonate.
    返回:
      the life ticks

  - ### setMaxLife

    boolean setMaxLife(int ticks)
    Set the time in ticks this firework will exist until it is detonated.
    参数:
      `ticks` - the ticks to set. Must be greater than 0
    返回:
      true if the time was set, false if this firework has already detonated

  - ### getMaxLife

    int getMaxLife()
    Get the time in ticks this firework will exist until it is detonated.
    返回:
      the maximum life in ticks

  - ### detonate

    void detonate()
    使烟花尽早爆炸, 像是它的引火线已燃烧殆尽.

    原文:Cause this firework to explode at earliest opportunity, as if it has no remaining fuse.

  - ### isDetonated

    boolean isDetonated()
    Check whether or not this firework has detonated.
    返回:
      true if detonated, false if still in the world

  - ### isShotAtAngle

    boolean isShotAtAngle()
    获取此烟花是否以一定角度发射 (比如使用弩). 若此值为false, 烟花将以垂直向上的方向飞行.

    原文: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.

    返回:
      此烟花是否以一定角度发射

  - ### setShotAtAngle

    void setShotAtAngle(boolean shotAtAngle)
    设置此烟花是否以一定角度发射 (比如使用弩). 若设置此值为false, 烟花将以垂直向上的方向飞行.

    原文: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.

    参数:
      `shotAtAngle` - 此烟花是否以一定角度发射