public interface PotionMeta extends ItemMeta, PotionDataHolder
ItemMeta.Spigot
Modifier and Type | Method and Description |
---|---|
boolean |
addCustomEffect(PotionEffect effect,
boolean overwrite)
Adds a custom potion effect to this potion.
|
boolean |
clearCustomEffects()
Removes all custom potion effects from this potion.
|
PotionMeta |
clone() |
PotionData |
getBasePotionData()
Returns the potion data about the base potion
|
Color |
getColor()
Gets the potion color that is set.
|
List<PotionEffect> |
getCustomEffects()
Gets an immutable list containing all custom potion effects applied to
this potion.
|
boolean |
hasColor()
Checks for existence of a potion color.
|
boolean |
hasCustomEffect(PotionEffectType type)
Checks for a specific custom potion effect type on this potion.
|
boolean |
hasCustomEffects()
Checks for the presence of custom potion effects.
|
boolean |
removeCustomEffect(PotionEffectType type)
Removes a custom potion effect from this potion.
|
void |
setBasePotionData(PotionData data)
Sets the underlying potion data
|
void |
setColor(Color color)
Sets the potion color.
|
boolean |
setMainEffect(PotionEffectType type)
Deprecated.
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable, spigot
serialize
clearCustomEffects0, copyFrom
void setBasePotionData(PotionData data)
setBasePotionData
in interface PotionDataHolder
data
- PotionData to set the base potion state toPotionData getBasePotionData()
getBasePotionData
in interface PotionDataHolder
boolean hasCustomEffects()
hasCustomEffects
in interface PotionDataHolder
List<PotionEffect> getCustomEffects()
Plugins should check that hasCustomEffects() returns true before calling this method.
getCustomEffects
in interface PotionDataHolder
boolean addCustomEffect(PotionEffect effect, boolean overwrite)
addCustomEffect
in interface PotionDataHolder
effect
- the potion effect to addoverwrite
- true if any existing effect of the same type should be
overwrittenboolean removeCustomEffect(PotionEffectType type)
removeCustomEffect
in interface PotionDataHolder
type
- the potion effect type to removeboolean hasCustomEffect(PotionEffectType type)
hasCustomEffect
in interface PotionDataHolder
type
- the potion effect type to check for@Deprecated boolean setMainEffect(PotionEffectType type)
PotionType(org.bukkit.potion.PotionEffectType, boolean, boolean)
This causes the client to display the potion effect in the potion's name.
type
- the potion effect type to moveboolean clearCustomEffects()
boolean hasColor()
hasColor
in interface PotionDataHolder
Color getColor()
Plugins should check that hasColor() returns true
before
calling this method.
getColor
in interface PotionDataHolder
void setColor(Color color)
setColor
in interface PotionDataHolder
color
- the color to setPotionMeta clone()
Copyright © 2021. All rights reserved.