Cloneable
, ConfigurationSerializable
, ItemMeta
, PersistentDataHolder
public interface PotionMeta extends ItemMeta
Modifier and Type | Method | Description |
---|---|---|
boolean |
addCustomEffect(@NotNull PotionEffect effect,
boolean overwrite) |
Adds a custom potion effect to this potion.
|
boolean |
clearCustomEffects() |
Removes all custom potion effects from this potion.
|
PotionMeta |
clone() |
|
@NotNull PotionData |
getBasePotionData() |
Returns the potion data about the base potion
|
@Nullable Color |
getColor() |
Gets the potion color that is set.
|
@NotNull 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(@NotNull 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(@NotNull PotionEffectType type) |
Removes a custom potion effect from this potion.
|
void |
setBasePotionData(@NotNull PotionData data) |
Sets the underlying potion data
|
void |
setColor(@Nullable Color color) |
Sets the potion color.
|
boolean |
setMainEffect(@NotNull PotionEffectType type) |
Deprecated.
|
serialize
addAttributeModifier, addEnchant, addItemFlags, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setLocalizedName, setLore, setPlaceableKeys, setUnbreakable, setVersion
getPersistentDataContainer
void setBasePotionData(@NotNull @NotNull PotionData data)
data
- PotionData to set the base potion state to@NotNull @NotNull PotionData getBasePotionData()
boolean hasCustomEffects()
@NotNull @NotNull List<PotionEffect> getCustomEffects()
Plugins should check that hasCustomEffects() returns true before calling this method.
boolean addCustomEffect(@NotNull @NotNull PotionEffect effect, boolean overwrite)
effect
- the potion effect to addoverwrite
- true if any existing effect of the same type should be
overwrittenboolean removeCustomEffect(@NotNull @NotNull PotionEffectType type)
type
- the potion effect type to removeboolean hasCustomEffect(@NotNull @NotNull PotionEffectType type)
type
- the potion effect type to check for@Deprecated boolean setMainEffect(@NotNull @NotNull PotionEffectType type)
This causes the client to display the potion effect in the potion's name.
type
- the potion effect type to moveboolean clearCustomEffects()
boolean hasColor()
@Nullable @Nullable Color getColor()
Plugins should check that hasColor() returns true
before
calling this method.
void setColor(@Nullable @Nullable Color color)
color
- the color to setPotionMeta clone()
Copyright © 2020. All rights reserved.