public interface PotionDataHolder
PotionMeta
, but is not necessarily an ItemMeta
.Modifier and Type | Method and Description |
---|---|
boolean |
addCustomEffect(PotionEffect effect,
boolean overwrite)
Adds a custom potion effect to this object.
|
void |
clearCustomEffects0()
Removes all custom potion effects.
|
default void |
copyFrom(PotionDataHolder source)
Copies potion data from another instance.
|
PotionData |
getBasePotionData()
Returns the potion data about the base potion
|
Color |
getColor()
Gets the color of this object.
|
List<PotionEffect> |
getCustomEffects()
Gets an immutable list containing all custom potion effects applied to
this object.
|
default boolean |
hasColor()
Checks for existence of a potion color.
|
boolean |
hasCustomEffect(PotionEffectType type)
Checks for a specific custom potion effect type on this object.
|
boolean |
hasCustomEffects()
Checks for the presence of custom potion effects.
|
boolean |
removeCustomEffect(PotionEffectType type)
Removes a custom potion effect from this object.
|
void |
setBasePotionData(PotionData data)
Sets the underlying potion data
|
void |
setColor(Color color)
Sets the color of this object.
|
void setBasePotionData(PotionData data)
data
- PotionData
to set the base potion state toPotionData getBasePotionData()
boolean hasCustomEffects()
List<PotionEffect> getCustomEffects()
Plugins should check that hasCustomEffects() returns true before calling this method.
boolean addCustomEffect(PotionEffect effect, boolean overwrite)
effect
- the potion effect to addoverwrite
- true if any existing effect of the same type should be
overwrittenboolean removeCustomEffect(PotionEffectType type)
type
- the potion effect type to removeIllegalArgumentException
- if this would place an item or entity in an invalid stateboolean hasCustomEffect(PotionEffectType type)
type
- the potion effect type to check fordefault boolean hasColor()
Color getColor()
void setColor(Color color)
color
- new colorvoid clearCustomEffects0()
TippedArrow.clearCustomEffects()
and
PotionMeta.clearCustomEffects()
.IllegalArgumentException
- if this would create an impossible item or entitydefault void copyFrom(PotionDataHolder source)
source
- the object to copy fromCopyright © 2021. All rights reserved.