类 PotionEffectType
- 所有已实现的接口:
Keyed
- 直接已知子类:
PotionEffectTypeWrapper
-
字段概要
字段修饰符和类型字段说明static final PotionEffectType
伤害吸收.static final PotionEffectType
不祥之兆.static final PotionEffectType
失明.static final PotionEffectType
潮涌能量.static final PotionEffectType
反胃.static final PotionEffectType
抗性提升.static final PotionEffectType
Causes the player's vision to dim occasionally.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
凋零. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明createEffect
(int duration, int amplifier) 以本效果类型创建一个药水效果, 并应用持续时间与倍率.boolean
static @Nullable PotionEffectType
getById
(int id) 已过时。魔法值static @Nullable PotionEffectType
根据指定 key 获取效果.static @Nullable PotionEffectType
根据指定名称获取效果.getColor()
返回本效果的颜色.abstract double
已过时。未被使用, 总是 1.0int
getId()
已过时。魔法值getKey()
返回用于此对象的命名空间标识符.getName()
返回本状态效果类型的名称.int
hashCode()
abstract boolean
返回本效果是否为瞬时型效果.static void
注册给定的状态效果类型对象.static void
停止接受任何新效果的注册.toString()
static @NotNull PotionEffectType[]
values()
返回一个所有已注册效果类型的数组.
-
字段详细资料
-
SPEED
速度. -
SLOW
缓慢. -
FAST_DIGGING
急迫. -
SLOW_DIGGING
挖掘疲劳. -
INCREASE_DAMAGE
力量. -
HEAL
瞬间治疗. -
HARM
瞬间伤害. -
JUMP
跳跃提升. -
CONFUSION
反胃. -
REGENERATION
生命恢复. -
DAMAGE_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
Causes the player's vision to dim occasionally.
-
-
构造器详细资料
-
PotionEffectType
-
-
方法详细资料
-
createEffect
以本效果类型创建一个药水效果, 并应用持续时间与倍率.原文:Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.
- 参数:
duration
- 效果持续时间, 以 tick 为单位amplifier
- 效果的倍率- 返回:
- 创建的药水效果
- 另请参阅:
-
getDurationModifier
已过时。未被使用, 总是 1.0返回应用于此效果类型的持续时间.原文:Returns the duration modifier applied to effects of this type.
- 返回:
- 持续时间
-
getId
已过时。魔法值返回本状态效果类型的唯一 ID.原文:Returns the unique ID of this type.
- 返回:
- 唯一 ID
-
getKey
从接口复制的说明:Keyed
返回用于此对象的命名空间标识符.原文:Return the namespaced identifier for this object.
-
getName
返回本状态效果类型的名称.原文:Returns the name of this effect type.
- 返回:
- 状态效果名
-
isInstant
public abstract boolean isInstant()返回本效果是否为瞬时型效果.原文:Returns whether the effect of this type happens once, immediately.
- 返回:
- 是否为瞬时型效果
-
getColor
返回本效果的颜色.原文:Returns the color of this effect type.
- 返回:
- 颜色
-
equals
-
hashCode
public int hashCode() -
toString
-
getByKey
@Contract("null -> null") @Nullable public static @Nullable PotionEffectType getByKey(@Nullable @Nullable NamespacedKey key) 根据指定 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
根据指定名称获取效果.原文:Gets the effect type specified by the given name.
- 参数:
name
- 状态效果名- 返回:
- 对应的效果类型, 如果找不到返回 null
-
registerPotionEffectType
注册给定的状态效果类型对象.通常不由插件使用.
原文:Registers an effect type with the given object.
Generally not to be used from within a plugin.
- 参数:
type
- 要注册的类型
-
stopAcceptingRegistrations
public static void stopAcceptingRegistrations()停止接受任何新效果的注册.原文:Stops accepting any effect type registrations.
-
values
返回一个所有已注册效果类型的数组. 此数组不一定按特定顺序编排.原文:Returns an array of all the registered
PotionEffectType
s. This array is not necessarily in any particular order.- 返回:
- 所有已注册效果类型的数组
-