接口 PotionMeta
-
方法概要
修饰符和类型方法说明booleanaddCustomEffect(@NotNull PotionEffect effect, boolean overwrite) 向此药水添加一个自定义药水效果.boolean移除这个药水的全部自定义药水效果.clone()已过时。返回关于这个基础药水(主药水)的药水类型.getColor()获取为这瓶药水设置的颜色.获取这个药水的全部自定义效果.获取已设置的药水名称翻译后缀.@org.jetbrains.annotations.Nullable float获取已设置的药水持续时间缩放.boolean检查是否存在基础药水类型.booleanhasColor()检查药水是否设置了自定义颜色.boolean检查这个药水是否有指定的药水效果.boolean检测这个药水是否存在药水效果.boolean检查是否存在自定义药水名称翻译后缀.boolean检查是否存在药水持续时间缩放.boolean移除这个药水的一个自定义效果.void已过时。升级/延长的药水现在是独立的PotionType,请使用setBasePotionType(org.bukkit.potion.PotionType)代替.void设置基础药水(主药水)的类型.void设置药水的颜色.voidsetCustomName(@Nullable String name) 设置药水名称翻译后缀.voidsetDurationScale(@Nullable Float scale) 设置药水持续时间缩放.boolean从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAdditionalTradeCost, getAsComponentString, getAsString, getAttackRange, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getBlocksAttacks, getBreakSound, getConsumable, getCustomModelData, getCustomModelDataComponent, getCustomTagContainer, getDamageResistances, getDamageResistant, getDamageType, getDamageTypeKey, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippable, getFood, getItemFlags, getItemModel, getItemName, getJukeboxPlayable, getKineticWeapon, getLocalizedName, getLore, getMaxStackSize, getMinimumAttackCharge, getPiercingWeapon, getRarity, getSwingAnimation, getTool, getTooltipStyle, getUseCooldown, getUseEffects, getUseRemainder, getWeapon, hasAdditionalTradeCost, hasAttackRange, hasAttributeModifiers, hasBlocksAttacks, hasBreakSound, hasConflictingEnchant, hasConsumable, hasCustomModelData, hasCustomModelDataComponent, hasDamageResistant, hasDamageType, hasDisplayName, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippable, hasFood, hasItemFlag, hasItemModel, hasItemName, hasJukeboxPlayable, hasKineticWeapon, hasLocalizedName, hasLore, hasMaxStackSize, hasMinimumAttackCharge, hasPiercingWeapon, hasRarity, hasSwingAnimation, hasTool, hasTooltipStyle, hasUseCooldown, hasUseEffects, hasUseRemainder, hasWeapon, isFireResistant, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAdditionalTradeCost, setAttackRange, setAttributeModifiers, setBlocksAttacks, setBreakSound, setConsumable, setCustomModelData, setCustomModelDataComponent, setDamageResistant, setDamageResistant, setDamageType, setDamageTypeKey, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippable, setFireResistant, setFood, setGlider, setHideTooltip, setItemModel, setItemName, setJukeboxPlayable, setKineticWeapon, setLocalizedName, setLore, setMaxStackSize, setMinimumAttackCharge, setPiercingWeapon, setRarity, setSwingAnimation, setTool, setTooltipStyle, setUnbreakable, setUseCooldown, setUseEffects, setUseRemainder, setVersion, setWeapon从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
setBasePotionData
已过时。升级/延长的药水现在是独立的PotionType,请使用setBasePotionType(org.bukkit.potion.PotionType)代替.设置底层药水数据.原文:Sets the underlying potion data
- 参数:
data- 要设置的基础药水状态的 PotionData
-
getBasePotionData
已过时。升级/延长的药水现在是独立的PotionType,请使用getBasePotionType()代替.返回关于基础药水的药水数据.原文:Returns the potion data about the base potion
- 返回:
- PotionData 对象
-
setBasePotionType
设置基础药水(主药水)的类型.原文: Sets the underlying potion type
- 参数:
type- 基础药水类型
-
getBasePotionType
返回关于这个基础药水(主药水)的药水类型.原文: Returns the potion type about the base potion
- 返回:
- PotionType 对象
-
hasBasePotionType
boolean hasBasePotionType()检查是否存在基础药水类型.原文:Checks for the presence of a base potion type
- 返回:
- 如果存在基础药水类型则为 true
-
hasCustomEffects
boolean hasCustomEffects()检测这个药水是否存在药水效果.原文: Checks for the presence of custom potion effects.
- 返回:
- 这个药水是否存在药水效果
-
getCustomEffects
获取这个药水的全部自定义效果.插件应该在调用这个方法之前检查 hasCustomEffects() 是否返回 true.
原文: Gets an immutable list containing all custom potion effects applied to this potion.
Plugins should check that hasCustomEffects() returns true before calling this method.
- 返回:
- 自定义效果列表 (不可变)
-
addCustomEffect
向此药水添加一个自定义药水效果.原文: Adds a custom potion effect to this potion.
- 参数:
effect- 要添加的药水效果overwrite- 如要覆盖已有的同类药水效果就设为 true- 返回:
- 如果药水的属性改变了则为 true
-
removeCustomEffect
移除这个药水的一个自定义效果.原文: Removes a custom potion effect from this potion.
- 参数:
type- 要移除的药水效果类型- 返回:
- 如果药水的属性改变了则为 true
-
hasCustomEffect
检查这个药水是否有指定的药水效果.原文: Checks for a specific custom potion effect type on this potion.
- 参数:
type- 要检查的药水效果- 返回:
- 存在此药水效果则返回 true
-
setMainEffect
移动一个药水效果至这个药水效果列表的顶端.这将会使客户端上的药水名称显示成设置的药水效果.
译注: 第一句不好理解? 比如有三个效果, 有个效果在最后面是最主要的效果, 我们就可以把这个效果移动到最顶上, 这样玩家第一眼看到的就是这个效果啦.
原文: Moves a potion effect to the top of the potion effect list.
This causes the client to display the potion effect in the potion's name.
- 参数:
type- 要移动的药水效果- 返回:
- 如果药水的属性改变了则为 true
-
clearCustomEffects
boolean clearCustomEffects()移除这个药水的全部自定义药水效果.原文: Removes all custom potion effects from this potion.
- 返回:
- 如果药水的属性改变了则为 true
-
hasColor
boolean hasColor()检查药水是否设置了自定义颜色.原文: Checks for existence of a potion color.
- 返回:
- 是否设置了自定义颜色
-
getColor
获取为这瓶药水设置的颜色. 此颜色可在物品栏中药水物品的格子内观察到.插件应该在调用这个方法之前检查 hasColor() 是否返回
true.原文: Gets the potion color that is set. A custom potion color will alter the display of the potion in an inventory slot.
Plugins should check that hasColor() returns
truebefore calling this method.- 返回:
- 药水颜色
-
setColor
设置药水的颜色. 此颜色可在物品栏中药水物品的格子内观察到.原文: Sets the potion color. A custom potion color will alter the display of the potion in an inventory slot.
- 参数:
color- 颜色
-
hasCustomName
boolean hasCustomName()检查是否存在自定义药水名称翻译后缀.原文:Checks for existence of a custom potion name translation suffix.
- 返回:
- 如果存在自定义药水名称则为 true
-
getCustomName
获取已设置的药水名称翻译后缀.插件应该在调用此方法之前检查 hasCustomName() 是否返回
true.原文:Gets the potion name translation suffix that is set. Plugins should check that hasCustomName() returns
truebefore calling this method.- 返回:
- 已设置的药水名称
-
setCustomName
设置药水名称翻译后缀.原文:Sets the potion name translation suffix.
- 参数:
name- 要设置的名称
-
hasDurationScale
boolean hasDurationScale()检查是否存在药水持续时间缩放.原文:Checks for existence of a potion duration scale.
- 返回:
- 如果存在药水持续时间缩放则为 true
-
getDurationScale
获取已设置的药水持续时间缩放.插件应该在调用此方法之前检查 hasDurationScale() 是否返回
true.原文:Gets the potion duration scale that is set. Plugins should check that hasDurationScale() returns
truebefore calling this method.- 返回:
- 应用于所有药水效果持续时间的缩放因子
-
setDurationScale
设置药水持续时间缩放.原文:Sets the potion duration scale.
- 参数:
scale- 应用于所有药水效果持续时间的缩放因子
-
clone
PotionMeta clone()
-
PotionType,请使用getBasePotionType()代替.