类 Potion
PotionMeta
.-
构造器概要
构造器说明Potion
(@NotNull PotionType type) 已过时。根据指定药水种类创建新药水.Potion
(@NotNull PotionType type, int level) 已过时。根据指定药水种类和级别创建新药水.Potion
(@NotNull PotionType type, int level, boolean splash) 已过时。Potion
(@NotNull PotionType type, int level, boolean splash, boolean extended) 已过时。 -
方法概要
修饰符和类型方法说明void
已过时。将此药水的状态效果应用于指定实体.void
已过时。将此药水的状态效果应用于指定物品堆.boolean
已过时。extend()
已过时。延长药水持续时间, 并返回自身用于链式调用.fromDamage
(int damage) 已过时。根据 damage 值获取药水.fromItemStack
(@NotNull ItemStack item) 已过时。static @NotNull PotionBrewer
已过时。返回一个PotionBrewer
实例.已过时。返回此药水应用于实体后的效果的列表.int
getLevel()
已过时。返回此药水的级别.int
已过时。无任何作用getType()
已过时。返回此药水的种类.boolean
已过时。返回此药水的时长是否可延长.int
hashCode()
已过时。boolean
isSplash()
已过时。返回是否为喷溅型药水.void
setHasExtendedDuration
(boolean isExtended) 已过时。设置此药水是否延长持续时间.void
setLevel
(int level) 已过时。设置药水的级别.static void
setPotionBrewer
(@NotNull PotionBrewer other) 已过时。设置当前的PotionBrewer
实例.void
setSplash
(boolean isSplash) 已过时。设置此药水是否为喷溅型药水.void
setType
(@NotNull PotionType type) 已过时。设置药水的种类.splash()
已过时。将药水改为喷溅型, 并返回自身用于链式调用.short
已过时。无任何作用toItemStack
(int amount) 已过时。将此药水转为一个指定堆叠数的物品堆.
-
构造器详细资料
-
Potion
已过时。根据指定药水种类创建新药水. 除非此药水种类为药水瓶, 级别将被设置为 1, 无持续时间的延长. 除了药水瓶, 不要使用此构造器创建无效果的药水.原文:Construct a new potion of the given type. Unless the type is
PotionType.WATER
, it will be level one, without extended duration. Don't use this constructor to create a no-effect potion other than water bottle.- 参数:
type
- The potion type
-
Potion
已过时。根据指定药水种类和级别创建新药水.原文:Create a new potion of the given type and level.
- 参数:
type
- 药水种类level
- 药水级别
-
Potion
已过时。赞成使用Potion(PotionType)
并调用splash()
.根据指定药水种类和级别创建新药水.原文:Create a new potion of the given type and level.
- 参数:
type
- 药水种类level
- 药水级别splash
- 是否为喷溅型药水
-
Potion
@Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash, boolean extended) 已过时。根据指定药水种类和级别创建新药水.原文:Create a new potion of the given type and level.
- 参数:
type
- 药水种类level
- 药水级别splash
- 是否为喷溅型药水extended
- 是否为延长版药水
-
-
方法详细资料
-
splash
已过时。将药水改为喷溅型, 并返回自身用于链式调用.原文:Chain this to the constructor to make the potion a splash potion.
- 返回:
- 药水对象
-
extend
已过时。延长药水持续时间, 并返回自身用于链式调用.原文:Chain this to the constructor to extend the potion's duration.
- 返回:
- 药水对象
-
apply
已过时。将此药水的状态效果应用于指定物品堆. 此物品堆必须为药水.原文:Applies the effects of this potion to the given
ItemStack
. The ItemStack must be a potion.- 参数:
to
- 物品堆
-
apply
已过时。将此药水的状态效果应用于指定实体.原文:Applies the effects that would be applied by this potion to the given
LivingEntity
.- 参数:
to
- 应用于哪个实体- 另请参阅:
-
equals
已过时。 -
getEffects
已过时。返回此药水应用于实体后的效果的列表.原文:Returns a collection of
PotionEffect
s that thisPotion
would confer upon aLivingEntity
.- 返回:
- 此药水应用后的效果
- 另请参阅:
-
getLevel
public int getLevel()已过时。返回此药水的级别.原文:Returns the level of this potion.
- 返回:
- 药水级别
-
getType
已过时。返回此药水的种类.原文:Returns the
PotionType
of this potion.- 返回:
- 药水的种类
-
hasExtendedDuration
public boolean hasExtendedDuration()已过时。返回此药水的时长是否可延长.原文:Returns whether this potion has an extended duration.
- 返回:
- 是否有延长版本的药水
-
hashCode
public int hashCode()已过时。 -
isSplash
public boolean isSplash()已过时。返回是否为喷溅型药水.原文:Returns whether this potion is a splash potion.
- 返回:
- 是否为喷溅型药水
-
setHasExtendedDuration
public void setHasExtendedDuration(boolean isExtended) 已过时。设置此药水是否延长持续时间. 这将导致此药水相比常规版本有约3/8倍的持续时间.原文:Set whether this potion has extended duration. This will cause the potion to have roughly 8/3 more duration than a regular potion.
- 参数:
isExtended
- 是否延长持续时间
-
setSplash
public void setSplash(boolean isSplash) 已过时。设置此药水是否为喷溅型药水. 喷溅型药水可作用于一定的范围.原文:Sets whether this potion is a splash potion. Splash potions can be thrown for a radius effect.
- 参数:
isSplash
- 是否为喷溅型药水
-
setType
已过时。设置药水的种类.原文:Sets the
PotionType
of this potion.- 参数:
type
- 药水的种类
-
setLevel
public void setLevel(int level) 已过时。设置药水的级别.原文:Sets the level of this potion.
- 参数:
level
- 药水级别
-
toDamageValue
已过时。无任何作用将此药水转化为合适的 damage 值, 对药水物品堆有用.原文:Converts this potion to a valid potion damage short, usable for potion item stacks.
- 返回:
- 药水的 damage 值
-
toItemStack
已过时。将此药水转为一个指定堆叠数的物品堆.原文:Converts this potion to an
ItemStack
with the specified amount and a correct damage value.- 参数:
amount
- 物品堆叠数- 返回:
- 物品堆
-
fromDamage
已过时。根据 damage 值获取药水.原文:Gets the potion from its damage value.
- 参数:
damage
- damage 值- 返回:
- 创建的药水
-
fromItemStack
已过时。 -
getBrewer
已过时。返回一个PotionBrewer
实例.原文:Returns an instance of
PotionBrewer
.- 返回:
- 一个
PotionBrewer
实例
-
setPotionBrewer
已过时。设置当前的PotionBrewer
实例. 通常不由插件使用.原文:Sets the current instance of
PotionBrewer
. Generally not to be used from within a plugin.- 参数:
other
- 新PotionBrewer
实例
-
getNameId
已过时。无任何作用根据 name id 获取药水对象.原文:Gets the potion from its name id.
- 返回:
- the name id
-
Potion(PotionType)
并调用splash()
.