类 PotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
- 所有已实现的接口:
Keyed,RegistryAware,Translatable
- 直接已知子类:
PotionEffectTypeWrapper
代表应用于实体上的药水和效果类型.
-
字段概要
字段修饰符和类型字段说明static final PotionEffectType伤害吸收.static final PotionEffectType不祥之兆.static final PotionEffectType失明.static final PotionEffectType潮涌能量.static final PotionEffectType黑暗static final PotionEffectType海豚的恩惠.static final PotionEffectType防火.static final PotionEffectType发光.static final PotionEffectType急迫.static final PotionEffectType生命提升.static final PotionEffectType村庄英雄.static final PotionEffectType饥饿.static final PotionEffectType寄生static final PotionEffectType瞬间伤害.static final PotionEffectType瞬间治疗.static final PotionEffectType隐身.static final PotionEffectType跳跃提升.static final PotionEffectType漂浮.static final PotionEffectType幸运.static final PotionEffectType挖掘疲劳.static final PotionEffectType反胃.static final PotionEffectType夜视.static final PotionEffectType渗浆static final PotionEffectType中毒.static final PotionEffectType袭击之兆static final PotionEffectType生命恢复.static final PotionEffectType抗性提升.static final PotionEffectType饱和.static final PotionEffectType缓降.static final PotionEffectType缓慢.static final PotionEffectType速度.static final PotionEffectType力量.static final PotionEffectType试炼之兆static final PotionEffectType霉运.static final PotionEffectType水下呼吸.static final PotionEffectType虚弱.static final PotionEffectType盘丝static final PotionEffectType蓄风static final PotionEffectType凋零. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract @NotNull PotionEffectcreateEffect(int duration, int amplifier) 以本效果类型创建一个药水效果, 并应用持续时间与倍率.static @Nullable PotionEffectTypegetById(int id) 已过时。魔法值static @Nullable PotionEffectType已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)static @Nullable PotionEffectType已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)abstract @NotNull PotionEffectTypeCategory返回本效果所属的分类.getColor()返回本效果的颜色.abstract double已过时。未被使用, 总是 1.0abstract intgetId()已过时。魔法值abstract @NotNull NamespacedKeygetKey()已过时。A key might not always be present, useRegistryAware.getKeyOrThrow()instead.getName()已过时。仅为保障向后兼容性, 请使用getKey()abstract boolean返回本效果是否为瞬时型效果.static @NotNull PotionEffectType[]values()已过时。请使用Iterable.iterator().从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.bukkit.registry.RegistryAware
getKeyOrNull, getKeyOrThrow, isRegistered从接口继承的方法 org.bukkit.Translatable
getTranslationKey
-
字段详细资料
-
SPEED
速度. -
SLOWNESS
缓慢. -
HASTE
急迫. -
MINING_FATIGUE
挖掘疲劳. -
STRENGTH
力量. -
INSTANT_HEALTH
瞬间治疗. -
INSTANT_DAMAGE
瞬间伤害. -
JUMP_BOOST
跳跃提升. -
NAUSEA
反胃. -
REGENERATION
生命恢复. -
RESISTANCE
抗性提升. -
FIRE_RESISTANCE
防火. -
WATER_BREATHING
水下呼吸. -
INVISIBILITY
隐身. -
BLINDNESS
失明. -
NIGHT_VISION
夜视. -
HUNGER
饥饿. -
WEAKNESS
虚弱. -
POISON
中毒. -
WITHER
凋零. -
HEALTH_BOOST
生命提升. -
ABSORPTION
伤害吸收. -
SATURATION
饱和. -
GLOWING
发光. -
LEVITATION
漂浮. -
LUCK
幸运. -
UNLUCK
霉运. -
SLOW_FALLING
缓降. -
CONDUIT_POWER
潮涌能量. -
DOLPHINS_GRACE
海豚的恩惠. -
BAD_OMEN
不祥之兆. -
HERO_OF_THE_VILLAGE
村庄英雄. -
DARKNESS
黑暗 -
TRIAL_OMEN
试炼之兆 -
RAID_OMEN
袭击之兆 -
WIND_CHARGED
蓄风 -
WEAVING
盘丝 -
OOZING
渗浆 -
INFESTED
寄生
-
-
构造器详细资料
-
PotionEffectType
public PotionEffectType()
-
-
方法详细资料
-
createEffect
以本效果类型创建一个药水效果, 并应用持续时间与倍率.原文:Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.
- 参数:
duration- 效果持续时间, 以 tick 为单位amplifier- 效果的倍率- 返回:
- 创建的药水效果
- 另请参阅:
-
isInstant
public abstract boolean isInstant()返回本效果是否为瞬时型效果.原文:Returns whether the effect of this type happens once, immediately.
- 返回:
- 是否为瞬时型效果
-
getCategory
- 返回:
- 分类
-
getColor
返回本效果的颜色.原文:Returns the color of this effect type.
- 返回:
- 颜色
-
getKey
已过时。A key might not always be present, useRegistryAware.getKeyOrThrow()instead.返回用于此对象的命名空间标识符.原文:Return the namespaced identifier for this object.
-
getDurationModifier
已过时。未被使用, 总是 1.0返回应用于此效果类型的持续时间.原文:Returns the duration modifier applied to effects of this type.
- 返回:
- 持续时间
-
getId
已过时。魔法值返回本状态效果类型的唯一 ID.原文:Returns the unique ID of this type.
- 返回:
- 唯一 ID
-
getName
已过时。仅为保障向后兼容性, 请使用getKey()返回本状态效果类型的名称.原文:Returns the name of this effect type.
- 返回:
- 状态效果名
-
getByKey
@Contract("null -> null") @Nullable @Deprecated(since="1.20.3") public static @Nullable PotionEffectType getByKey(@Nullable @Nullable NamespacedKey key) 已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)根据指定 key 获取效果.原文:Gets the PotionEffectType at the specified key
- 参数:
key- 效果键名- 返回:
- 对应的效果类型, 如果找不到返回 null
-
getById
已过时。魔法值根据唯一 ID 获取效果.原文:Gets the effect type specified by the unique id.
- 参数:
id- 唯一 ID- 返回:
- 对应的效果类型, 如果找不到返回 null
-
getByName
@Nullable @Deprecated(since="1.20.3") public static @Nullable PotionEffectType getByName(@NotNull @NotNull String name) 已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)根据指定名称获取效果.原文:Gets the effect type specified by the given name.
- 参数:
name- 状态效果名- 返回:
- 对应的效果类型, 如果找不到返回 null
-
values
已过时。请使用Iterable.iterator().- 返回:
- 所有已知效果类型的数组
-