public interface PotionMeta extends ItemMeta
Material.POTION
) that can have custom effects.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() |
List<PotionEffect> |
getCustomEffects()
Gets an immutable list containing all custom potion effects applied to
this potion.
|
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.
|
boolean |
setMainEffect(PotionEffectType type)
Moves a potion effect to the top of the potion effect list.
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLore, removeEnchant, removeItemFlags, setDisplayName, setLore, spigot
serialize
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 removeboolean hasCustomEffect(PotionEffectType type)
type
- the potion effect type to check forboolean setMainEffect(PotionEffectType type)
This causes the client to display the potion effect in the potion's name.
type
- the potion effect type to moveboolean clearCustomEffects()
PotionMeta clone()
Copyright © 2022. All rights reserved.