接口 Firework

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

public interface Firework extends Projectile
烟花火箭实体.
  • 方法详细资料

    • 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

      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 - 此烟花是否以一定角度发射