接口 AreaEffectCloud

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

public interface AreaEffectCloud extends Entity
代表一片即将对处于其中的生物施加药水效果的区域效果云 (即喷溅药水使用后形成的雾).

参考: 区块格式#AreaEffectCloud 滞留药水

  • 方法详细资料

    • getDuration

      int getDuration()
      获取这片云存在的时间 (单位为tick).

      原文: Gets the duration which this cloud will exist for (in ticks).

      返回:
      持续时间
    • setDuration

      void setDuration(int duration)
      设置这片云存在的时间 (单位为tick).

      原文: Sets the duration which this cloud will exist for (in ticks).

      参数:
      duration - 持续时间
    • getWaitTime

      int getWaitTime()
      获取实体受到效果前的延迟的时间.

      原文: Gets the time which an entity has to be exposed to the cloud before the effect is applied.

      返回:
      延迟时间
    • setWaitTime

      void setWaitTime(int waitTime)
      设置实体受到效果前的延迟时间.

      原文: Sets the time which an entity has to be exposed to the cloud before the effect is applied.

      参数:
      waitTime - 延迟时间
    • getReapplicationDelay

      int getReapplicationDelay()
      获取实体受到效果后的免疫时间.

      原文: Gets the time that an entity will be immune from subsequent exposure.

      返回:
      免疫时间
    • setReapplicationDelay

      void setReapplicationDelay(int delay)
      设置实体受到效果后的免疫时间.

      原文: Sets the time that an entity will be immune from subsequent exposure.

      参数:
      delay - 免疫时间
    • getDurationOnUse

      int getDurationOnUse()
      获取这片云对一个实体产生效果后持续时间应减少多少.

      原文: Gets the amount that the duration of this cloud will decrease by when it applies an effect to an entity.

      返回:
      持续时间的变化量
    • setDurationOnUse

      void setDurationOnUse(int duration)
      设置这片云对一个实体产生效果后持续时间应减少多少.

      原文: Sets the amount that the duration of this cloud will decrease by when it applies an effect to an entity.

      参数:
      duration - 持续时间的变化量
    • getRadius

      float getRadius()
      获取这片云的初始半径.

      原文: Gets the initial radius of the cloud.

      返回:
      半径
    • setRadius

      void setRadius(float radius)
      设置这片云的初始半径.

      原文: Sets the initial radius of the cloud.

      参数:
      radius - 半径
    • getRadiusOnUse

      float getRadiusOnUse()
      获取这片云对一个实体产生效果后半径应该减少多少.

      原文: Gets the amount that the radius of this cloud will decrease by when it applies an effect to an entity.

      返回:
      半径的变化量
    • setRadiusOnUse

      void setRadiusOnUse(float radius)
      设置这片云对一个实体产生效果后半径应该减少多少.

      原文: Sets the amount that the radius of this cloud will decrease by when it applies an effect to an entity.

      参数:
      radius - 半径的变化量
    • getRadiusPerTick

      float getRadiusPerTick()
      获取每tick这片云的半径应缩小多少.

      原文: Gets the amount that the radius of this cloud will decrease by each tick.

      返回:
      每 tick 这片云的半径减少量
    • setRadiusPerTick

      void setRadiusPerTick(float radius)
      设置每一tick这片云的半径应缩小多少.

      原文(疑似有误, get应为set): Gets the amount that the radius of this cloud will decrease by each tick.

      参数:
      radius - 每 tick 这片云的半径减少量
    • getParticle

      @NotNull @NotNull Particle getParticle()
      获取组成这片云的粒子.

      原文: Gets the particle which this cloud will be composed of

      返回:
      粒子类型
    • setParticle

      void setParticle(@NotNull @NotNull Particle particle)
      设置组成这片云的粒子.

      原文: Sets the particle which this cloud will be composed of

      参数:
      particle - 新的粒子类型
    • setParticle

      <T> void setParticle(@NotNull @NotNull Particle particle, @Nullable T data)
      设置组成这片云的粒子.

      原文: Sets the particle which this cloud will be composed of

      类型参数:
      T - 粒子效果数据的类型 (参阅 Particle.getDataType()
      参数:
      particle - 新的粒子类型
      data - 为此粒子效果使用的数据, 可为null, 数据类型取决于 Particle.getDataType()
    • setBasePotionData

      void setBasePotionData(@NotNull @NotNull PotionData data)
      设置基本药水数据.

      原文: Sets the underlying potion data

      参数:
      data - 用于设置基本药水状态的 PotionData
    • getBasePotionData

      @NotNull @NotNull PotionData getBasePotionData()
      返回基本药水的药水数据.

      原文: Returns the potion data about the base potion

      返回:
      一个 PotionData 对象.
    • hasCustomEffects

      boolean hasCustomEffects()
      检查自定义药水效果是否有效.

      原文: Checks for the presence of custom potion effects.

      返回:
      如果自定义药水效果有效则返回true
    • getCustomEffects

      @NotNull @NotNull List<PotionEffect> getCustomEffects()
      获取这片云的全部自定义药水效果. 插件应该在调用这个方法之前检查 hasCustomEffects() 是否返回 true.

      原文: Gets an immutable list containing all custom potion effects applied to this cloud. Plugins should check that hasCustomEffects() returns true before calling this method.

      返回:
      自定义药水效果的不可变集合
    • addCustomEffect

      boolean addCustomEffect(@NotNull @NotNull PotionEffect effect, boolean overwrite)
      向这片云添加一个自定义药水效果.

      原文: Adds a custom potion effect to this cloud.

      参数:
      effect - 添加的药水效果
      overwrite - 是否覆盖当前存在的相同类型效果
      返回:
      如果这次调用成功添加效果则返回true
    • removeCustomEffect

      boolean removeCustomEffect(@NotNull @NotNull PotionEffectType type)
      从这片云移除一个自定义药水效果.

      原文: Removes a custom potion effect from this cloud.

      参数:
      type - 移除的药水效果类型
      返回:
      如果这次调用成功移除效果则返回true
    • hasCustomEffect

      boolean hasCustomEffect(@Nullable @Nullable PotionEffectType type)
      检查这片云中是否存在一种特定的自定义药水效果类型.

      原文: Checks for a specific custom potion effect type on this cloud.

      参数:
      type - 检查的药水效果类型
      返回:
      存在这种效果则返回true
    • clearCustomEffects

      void clearCustomEffects()
      从这片云移除所有自定义药水效果.

      原文: Removes all custom potion effects from this cloud.

    • getColor

      @NotNull @NotNull Color getColor()
      获取这片云的颜色, 即粒子的颜色.

      原文: Gets the color of this cloud. Will be applied as a tint to its particles.

      返回:
      云的颜色
    • setColor

      void setColor(@NotNull @NotNull Color color)
      设置这片云的颜色, 即粒子的颜色.

      原文: Sets the color of this cloud. Will be applied as a tint to its particles.

      参数:
      color - 云的颜色
    • getSource

      检索这片云的初始来源.

      原文: Retrieve the original source of this cloud.

      返回:
      投掷药水的 ProjectileSource
    • setSource

      void setSource(@Nullable @Nullable ProjectileSource source)
      设置这片云的初始来源.

      原文: Set the original source of this cloud.

      参数:
      source - 投掷药水的ProjectileSource