类 PotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
- 所有已实现的接口:
Keyed
,Translatable
- 直接已知子类:
PotionEffectTypeWrapper
代表应用于实体上的药水和效果类型.
-
字段概要
修饰符和类型字段说明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
Chance of spawning silverfish when hurt.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
Causes slimes to spawn upon death.static final PotionEffectType
中毒.static final PotionEffectType
Triggers a raid when a player enters a village.static final PotionEffectType
生命恢复.static final PotionEffectType
抗性提升.static final PotionEffectType
饱和.static final PotionEffectType
缓降.static final PotionEffectType
缓慢.static final PotionEffectType
速度.static final PotionEffectType
力量.static final PotionEffectType
Causes trial spawners to become ominous.static final PotionEffectType
霉运.static final PotionEffectType
水下呼吸.static final PotionEffectType
虚弱.static final PotionEffectType
Creates cobwebs upon death.static final PotionEffectType
Emits a wind burst upon death.static final PotionEffectType
凋零. -
构造器概要
-
方法概要
修饰符和类型方法说明abstract @NotNull PotionEffect
createEffect
(int duration, int amplifier) 以本效果类型创建一个药水效果, 并应用持续时间与倍率.static @Nullable PotionEffectType
getById
(int id) 已过时。魔法值static @Nullable PotionEffectType
已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)
static @Nullable PotionEffectType
已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)
abstract @NotNull PotionEffectTypeCategory
返回本效果所属的分类
.getColor()
返回本效果的颜色.abstract double
已过时。未被使用, 总是 1.0abstract int
getId()
已过时。魔法值getName()
已过时。仅为保障向后兼容性, 请使用Keyed.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.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
Causes the player's vision to dim occasionally. -
TRIAL_OMEN
Causes trial spawners to become ominous. -
RAID_OMEN
Triggers a raid when a player enters a village. -
WIND_CHARGED
Emits a wind burst upon death. -
WEAVING
Creates cobwebs upon death. -
OOZING
Causes slimes to spawn upon death. -
INFESTED
Chance of spawning silverfish when hurt.
-
-
构造器详细资料
-
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.
- 返回:
- 颜色
-
getDurationModifier
已过时。未被使用, 总是 1.0返回应用于此效果类型的持续时间.原文:Returns the duration modifier applied to effects of this type.
- 返回:
- 持续时间
-
getId
已过时。魔法值返回本状态效果类型的唯一 ID.原文:Returns the unique ID of this type.
- 返回:
- 唯一 ID
-
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
已过时。魔法值根据唯一 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
已过时。请使用Iterable.iterator()
.- 返回:
- 所有已知效果类型的数组
-