Package org.bukkit.inventory.meta
Interface PotionMeta
- All Superinterfaces:
- Cloneable,- ConfigurationSerializable,- ItemMeta,- PersistentDataHolder
Represents a potion or item that can have custom effects.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddCustomEffect(PotionEffect effect, boolean overwrite) Adds a custom potion effect to this potion.booleanRemoves all custom potion effects from this potion.clone()Deprecated.Returns the potion type about the base potiongetColor()Gets the potion color that is set.Gets an immutable list containing all custom potion effects applied to this potion.Gets the potion name translation suffix that is set.booleanChecks for the presence of a base potion typebooleanhasColor()Checks for existence of a potion color.booleanChecks for a specific custom potion effect type on this potion.booleanChecks for the presence of custom potion effects.booleanChecks for existence of a custom potion name translation suffix.booleanRemoves a custom potion effect from this potion.voidsetBasePotionData(PotionData data) Deprecated.Upgraded / extended potions are now their ownPotionTypeusesetBasePotionType(org.bukkit.potion.PotionType)instead.voidsetBasePotionType(PotionType type) Sets the underlying potion typevoidSets the potion color.voidsetCustomName(String name) Sets the potion name translation suffix.booleanDeprecated.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserializeMethods inherited from interface org.bukkit.inventory.meta.ItemMetaaddAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getConsumable, getCustomModelData, getCustomModelDataComponent, getCustomTagContainer, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippable, getFood, getItemFlags, getItemModel, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, getTooltipStyle, getUseCooldown, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasConsumable, hasCustomModelData, hasDamageResistant, hasDisplayName, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippable, hasFood, hasItemFlag, hasItemModel, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, hasTooltipStyle, hasUseCooldown, hasUseRemainder, isFireResistant, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setConsumable, setCustomModelData, setCustomModelDataComponent, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippable, setFireResistant, setFood, setGlider, setHideTooltip, setItemModel, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setTooltipStyle, setUnbreakable, setUseCooldown, setUseRemainder, setVersionMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainer
- 
Method Details- 
setBasePotionDataDeprecated.Upgraded / extended potions are now their ownPotionTypeusesetBasePotionType(org.bukkit.potion.PotionType)instead.Sets the underlying potion data- Parameters:
- data- PotionData to set the base potion state to
 
- 
getBasePotionDataDeprecated.Upgraded / extended potions are now their ownPotionTypeusegetBasePotionType()instead.Returns the potion data about the base potion- Returns:
- a PotionData object
 
- 
setBasePotionTypeSets the underlying potion type- Parameters:
- type- PotionType to set the base potion state to
 
- 
getBasePotionTypeReturns the potion type about the base potion- Returns:
- a PotionType object
 
- 
hasBasePotionTypeboolean hasBasePotionType()Checks for the presence of a base potion type- Returns:
- true if a base potion type is present
 
- 
hasCustomEffectsboolean hasCustomEffects()Checks for the presence of custom potion effects.- Returns:
- true if custom potion effects are applied
 
- 
getCustomEffectsGets an immutable list containing all custom potion effects applied to this potion.Plugins should check that hasCustomEffects() returns true before calling this method. - Returns:
- the immutable list of custom potion effects
 
- 
addCustomEffectAdds a custom potion effect to this potion.- Parameters:
- effect- the potion effect to add
- overwrite- true if any existing effect of the same type should be overwritten
- Returns:
- true if the potion meta changed as a result of this call
 
- 
removeCustomEffectRemoves a custom potion effect from this potion.- Parameters:
- type- the potion effect type to remove
- Returns:
- true if the potion meta changed as a result of this call
 
- 
hasCustomEffectChecks for a specific custom potion effect type on this potion.- Parameters:
- type- the potion effect type to check for
- Returns:
- true if the potion has this effect
 
- 
setMainEffectDeprecated.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. - Parameters:
- type- the potion effect type to move
- Returns:
- true if the potion meta changed as a result of this call
 
- 
clearCustomEffectsboolean clearCustomEffects()Removes all custom potion effects from this potion.- Returns:
- true if the potion meta changed as a result of this call
 
- 
hasColorboolean hasColor()Checks for existence of a potion color.- Returns:
- true if this has a custom potion color
 
- 
getColorGets 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.- Returns:
- the potion color that is set
 
- 
setColorSets the potion color. A custom potion color will alter the display of the potion in an inventory slot.- Parameters:
- color- the color to set
 
- 
hasCustomNameboolean hasCustomName()Checks for existence of a custom potion name translation suffix.- Returns:
- true if this has a custom potion name
 
- 
getCustomNameGets the potion name translation suffix that is set.Plugins should check that hasCustomName() returns truebefore calling this method.- Returns:
- the potion name that is set
 
- 
setCustomNameSets the potion name translation suffix.- Parameters:
- name- the name to set
 
- 
clonePotionMeta clone()
 
- 
PotionTypeusegetBasePotionType()instead.