程序包 org.bukkit.potion

# 类 PotionEffectType

java.lang.Object
org.bukkit.potion.PotionEffectType

所有已实现的接口:
  `Keyed`, `Translatable`

直接已知子类:
  `PotionEffectTypeWrapper`

public abstract class PotionEffectType extends Object implements Keyed, Translatable
代表应用于实体上的药水和效果类型.

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `static final PotionEffectType`
  `ABSORPTION`
  伤害吸收.
  `static final PotionEffectType`
  `BAD_OMEN`
  不祥之兆.
  `static final PotionEffectType`
  `BLINDNESS`
  失明.
  `static final PotionEffectType`
  `CONDUIT_POWER`
  潮涌能量.
  `static final PotionEffectType`
  `DARKNESS`
  Causes the player's vision to dim occasionally.
  `static final PotionEffectType`
  `DOLPHINS_GRACE`
  海豚的恩惠.
  `static final PotionEffectType`
  `FIRE_RESISTANCE`
  防火.
  `static final PotionEffectType`
  `GLOWING`
  发光.
  `static final PotionEffectType`
  `HASTE`
  急迫.
  `static final PotionEffectType`
  `HEALTH_BOOST`
  生命提升.
  `static final PotionEffectType`
  `HERO_OF_THE_VILLAGE`
  村庄英雄.
  `static final PotionEffectType`
  `HUNGER`
  饥饿.
  `static final PotionEffectType`
  `INFESTED`
  Chance of spawning silverfish when hurt.
  `static final PotionEffectType`
  `INSTANT_DAMAGE`
  瞬间伤害.
  `static final PotionEffectType`
  `INSTANT_HEALTH`
  瞬间治疗.
  `static final PotionEffectType`
  `INVISIBILITY`
  隐身.
  `static final PotionEffectType`
  `JUMP_BOOST`
  跳跃提升.
  `static final PotionEffectType`
  `LEVITATION`
  漂浮.
  `static final PotionEffectType`
  `LUCK`
  幸运.
  `static final PotionEffectType`
  `MINING_FATIGUE`
  挖掘疲劳.
  `static final PotionEffectType`
  `NAUSEA`
  反胃.
  `static final PotionEffectType`
  `NIGHT_VISION`
  夜视.
  `static final PotionEffectType`
  `OOZING`
  Causes slimes to spawn upon death.
  `static final PotionEffectType`
  `POISON`
  中毒.
  `static final PotionEffectType`
  `RAID_OMEN`
  Triggers a raid when a player enters a village.
  `static final PotionEffectType`
  `REGENERATION`
  生命恢复.
  `static final PotionEffectType`
  `RESISTANCE`
  抗性提升.
  `static final PotionEffectType`
  `SATURATION`
  饱和.
  `static final PotionEffectType`
  `SLOW_FALLING`
  缓降.
  `static final PotionEffectType`
  `SLOWNESS`
  缓慢.
  `static final PotionEffectType`
  `SPEED`
  速度.
  `static final PotionEffectType`
  `STRENGTH`
  力量.
  `static final PotionEffectType`
  `TRIAL_OMEN`
  Causes trial spawners to become ominous.
  `static final PotionEffectType`
  `UNLUCK`
  霉运.
  `static final PotionEffectType`
  `WATER_BREATHING`
  水下呼吸.
  `static final PotionEffectType`
  `WEAKNESS`
  虚弱.
  `static final PotionEffectType`
  `WEAVING`
  Creates cobwebs upon death.
  `static final PotionEffectType`
  `WIND_CHARGED`
  Emits a wind burst upon death.
  `static final PotionEffectType`
  `WITHER`
  凋零.

- ## 构造器概要

  构造器
  构造器
  说明
  `PotionEffectType()`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `abstract @NotNull PotionEffect`
  `createEffect(int duration, int amplifier)`
  以本效果类型创建一个药水效果, 并应用持续时间与倍率.
  `static @Nullable PotionEffectType`
  `getById(int id)`
  已过时。
  魔法值
  `static @Nullable PotionEffectType`
  `getByKey(@Nullable NamespacedKey key)`
  已过时。
  仅为保障向后兼容性, 请使用 `Registry.get(NamespacedKey)`
  `static @Nullable PotionEffectType`
  `getByName(@NotNull String name)`
  已过时。
  仅为保障向后兼容性, 请使用 `Registry.get(NamespacedKey)`
  `abstract @NotNull PotionEffectTypeCategory`
  `getCategory()`
  返回本效果所属的`分类`.
  `abstract @NotNull Color`
  `getColor()`
  返回本效果的颜色.
  `abstract double`
  `getDurationModifier()`
  已过时。
  未被使用, 总是 1.0
  `abstract int`
  `getId()`
  已过时。
  魔法值
  `abstract @NotNull String`
  `getName()`
  已过时。
  仅为保障向后兼容性, 请使用 `Keyed.getKey()`
  `abstract boolean`
  `isInstant()`
  返回本效果是否为瞬时型效果.
  `static @NotNull PotionEffectType[]`
  `values()`
  已过时。
  请使用 `Iterable.iterator()`.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

  `getKey`

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

  `getTranslationKey`

- ## 字段详细资料

  - ### SPEED

    public static final PotionEffectType SPEED
    速度.

  - ### SLOWNESS

    public static final PotionEffectType SLOWNESS
    缓慢.

  - ### HASTE

    public static final PotionEffectType HASTE
    急迫.

  - ### MINING_FATIGUE

    public static final PotionEffectType MINING_FATIGUE
    挖掘疲劳.

  - ### STRENGTH

    public static final PotionEffectType STRENGTH
    力量.

  - ### INSTANT_HEALTH

    public static final PotionEffectType INSTANT_HEALTH
    瞬间治疗.

  - ### INSTANT_DAMAGE

    public static final PotionEffectType INSTANT_DAMAGE
    瞬间伤害.

  - ### JUMP_BOOST

    public static final PotionEffectType JUMP_BOOST
    跳跃提升.

  - ### NAUSEA

    public static final PotionEffectType NAUSEA
    反胃.

  - ### REGENERATION

    public static final PotionEffectType REGENERATION
    生命恢复.

  - ### RESISTANCE

    public static final PotionEffectType RESISTANCE
    抗性提升.

  - ### FIRE_RESISTANCE

    public static final PotionEffectType FIRE_RESISTANCE
    防火.

  - ### WATER_BREATHING

    public static final PotionEffectType WATER_BREATHING
    水下呼吸.

  - ### INVISIBILITY

    public static final PotionEffectType INVISIBILITY
    隐身.

  - ### BLINDNESS

    public static final PotionEffectType BLINDNESS
    失明.

  - ### NIGHT_VISION

    public static final PotionEffectType NIGHT_VISION
    夜视.

  - ### HUNGER

    public static final PotionEffectType HUNGER
    饥饿.

  - ### WEAKNESS

    public static final PotionEffectType WEAKNESS
    虚弱.

  - ### POISON

    public static final PotionEffectType POISON
    中毒.

  - ### WITHER

    public static final PotionEffectType WITHER
    凋零.

  - ### HEALTH_BOOST

    public static final PotionEffectType HEALTH_BOOST
    生命提升.

  - ### ABSORPTION

    public static final PotionEffectType ABSORPTION
    伤害吸收.

  - ### SATURATION

    public static final PotionEffectType SATURATION
    饱和.

  - ### GLOWING

    public static final PotionEffectType GLOWING
    发光.

  - ### LEVITATION

    public static final PotionEffectType LEVITATION
    漂浮.

  - ### LUCK

    public static final PotionEffectType LUCK
    幸运.

  - ### UNLUCK

    public static final PotionEffectType UNLUCK
    霉运.

  - ### SLOW_FALLING

    public static final PotionEffectType SLOW_FALLING
    缓降.

  - ### CONDUIT_POWER

    public static final PotionEffectType CONDUIT_POWER
    潮涌能量.

  - ### DOLPHINS_GRACE

    public static final PotionEffectType DOLPHINS_GRACE
    海豚的恩惠.

  - ### BAD_OMEN

    public static final PotionEffectType BAD_OMEN
    不祥之兆.

  - ### HERO_OF_THE_VILLAGE

    public static final PotionEffectType HERO_OF_THE_VILLAGE
    村庄英雄.

  - ### DARKNESS

    public static final PotionEffectType DARKNESS
    Causes the player's vision to dim occasionally.

  - ### TRIAL_OMEN

    public static final PotionEffectType TRIAL_OMEN
    Causes trial spawners to become ominous.

  - ### RAID_OMEN

    public static final PotionEffectType RAID_OMEN
    Triggers a raid when a player enters a village.

  - ### WIND_CHARGED

    public static final PotionEffectType WIND_CHARGED
    Emits a wind burst upon death.

  - ### WEAVING

    public static final PotionEffectType WEAVING
    Creates cobwebs upon death.

  - ### OOZING

    public static final PotionEffectType OOZING
    Causes slimes to spawn upon death.

  - ### INFESTED

    public static final PotionEffectType INFESTED
    Chance of spawning silverfish when hurt.

- ## 构造器详细资料

  - ### PotionEffectType

    public PotionEffectType()

- ## 方法详细资料

  - ### createEffect

    @NotNull public abstract @NotNull PotionEffect createEffect(int duration, int amplifier)
    以本效果类型创建一个药水效果, 并应用持续时间与倍率.

    原文:Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.

    参数:
      `duration` - 效果持续时间, 以 tick 为单位
      `amplifier` - 效果的倍率
    返回:
      创建的药水效果
    另请参阅:
      - `PotionBrewer.createEffect(PotionEffectType, int, int)`

  - ### isInstant

    public abstract boolean isInstant()
    返回本效果是否为瞬时型效果.

    原文:Returns whether the effect of this type happens once, immediately.

    返回:
      是否为瞬时型效果

  - ### getCategory

    @NotNull public abstract @NotNull PotionEffectTypeCategory getCategory()
    返回本效果所属的`分类`.

    原文:Returns the `category` of this effect type.

    返回:
      分类

  - ### getColor

    @NotNull public abstract @NotNull Color getColor()
    返回本效果的颜色.

    原文:Returns the color of this effect type.

    返回:
      颜色

  - ### getDurationModifier

    @Deprecated public abstract double getDurationModifier()
    已过时。
    未被使用, 总是 1.0
    返回应用于此效果类型的持续时间.

    原文:Returns the duration modifier applied to effects of this type.

    返回:
      持续时间

  - ### getId

    @Deprecated public abstract int getId()
    已过时。
    魔法值
    返回本状态效果类型的唯一 ID.

    原文:Returns the unique ID of this type.

    返回:
      唯一 ID

  - ### getName

    @NotNull @Deprecated public abstract @NotNull String getName()
    已过时。
    仅为保障向后兼容性, 请使用 `Keyed.getKey()`
    返回本状态效果类型的名称.

    原文:Returns the name of this effect type.

    返回:
      状态效果名

  - ### getByKey

    @Contract("null -> null") @Nullable @Deprecated public static @Nullable PotionEffectType getByKey(@Nullable @Nullable NamespacedKey key)
    已过时。
    仅为保障向后兼容性, 请使用 `Registry.get(NamespacedKey)`
    根据指定 key 获取效果.

    原文:Gets the PotionEffectType at the specified key

    参数:
      `key` - 效果键名
    返回:
      对应的效果类型, 如果找不到返回 null

  - ### getById

    @Deprecated @Nullable public static @Nullable PotionEffectType getById(int id)
    已过时。
    魔法值
    根据唯一 ID 获取效果.

    原文:Gets the effect type specified by the unique id.

    参数:
      `id` - 唯一 ID
    返回:
      对应的效果类型, 如果找不到返回 null

  - ### getByName

    @Nullable @Deprecated public static @Nullable PotionEffectType getByName(@NotNull @NotNull String name)
    已过时。
    仅为保障向后兼容性, 请使用 `Registry.get(NamespacedKey)`
    根据指定名称获取效果.

    原文:Gets the effect type specified by the given name.

    参数:
      `name` - 状态效果名
    返回:
      对应的效果类型, 如果找不到返回 null

  - ### values

    @NotNull @Deprecated public static @NotNull PotionEffectType[] values()
    已过时。
    请使用 `Iterable.iterator()`.
    返回:
      所有已知效果类型的数组