Class PotionMeta
java.lang.Object
net.minestom.server.item.metadata.PotionMeta
- All Implemented Interfaces:
ItemMeta
public class PotionMeta extends java.lang.Object implements ItemMeta
Item meta for
Material.POTION
,
Material.LINGERING_POTION
,
Material.SPLASH_POTION
,
Material.TIPPED_ARROW
.-
Constructor Summary
Constructors Constructor Description PotionMeta()
-
Method Summary
Modifier and Type Method Description ItemMeta
copy()
Copies this item meta.java.util.List<CustomPotionEffect>
getCustomPotionEffects()
Get a list ofCustomPotionEffect
.PotionType
getPotionType()
Gets the potion type.boolean
hasNbt()
Gets if this meta object contains any useful data to send to the client.boolean
isSimilar(ItemMeta itemMeta)
Gets if the two ItemMeta are similar.void
read(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Reads nbt data from a compound.void
setColor(ChatColor color)
Changes the color of the potion.void
setPotionType(PotionType potionType)
Changes the potion type.void
write(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Writes nbt data to a compound.
-
Constructor Details
-
PotionMeta
public PotionMeta()
-
-
Method Details
-
getPotionType
Gets the potion type.- Returns:
- the potion type
-
setPotionType
Changes the potion type.- Parameters:
potionType
- the new potion type
-
getCustomPotionEffects
Get a list ofCustomPotionEffect
.- Returns:
- the custom potion effects
-
setColor
Changes the color of the potion.- Parameters:
color
- the new color of the potion
-
hasNbt
public boolean hasNbt()Description copied from interface:ItemMeta
Gets if this meta object contains any useful data to send to the client. -
isSimilar
Description copied from interface:ItemMeta
Gets if the two ItemMeta are similar.It is used by
ItemStack.isSimilar(ItemStack)
. -
read
public void read(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Reads nbt data from a compound.WARNING: it is possible that it contains no useful data, it has to be checked before getting anything.
-
write
public void write(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Writes nbt data to a compound. -
copy
Description copied from interface:ItemMeta
Copies this item meta.Used by
ItemStack.copy()
.
-