Class EnchantedBookMeta
java.lang.Object
net.minestom.server.item.metadata.EnchantedBookMeta
- All Implemented Interfaces:
ItemMeta
public class EnchantedBookMeta extends java.lang.Object implements ItemMeta
-
Constructor Summary
Constructors Constructor Description EnchantedBookMeta()
-
Method Summary
Modifier and Type Method Description ItemMeta
copy()
Copies this item meta.int
getStoredEnchantmentLevel(Enchantment enchantment)
Gets a stored enchantment level.java.util.Map<Enchantment,java.lang.Short>
getStoredEnchantmentMap()
Gets the stored enchantment map.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
removeStoredEnchantment(Enchantment enchantment)
Removes a stored enchantment.void
setStoredEnchantment(Enchantment enchantment, short level)
Sets a stored enchantment level.void
write(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Writes nbt data to a compound.
-
Constructor Details
-
EnchantedBookMeta
public EnchantedBookMeta()
-
-
Method Details
-
getStoredEnchantmentMap
Gets the stored enchantment map. Stored enchantments are used on enchanted book.- Returns:
- an unmodifiable map containing the item stored enchantments
-
setStoredEnchantment
Sets a stored enchantment level.- Parameters:
enchantment
- the enchantment typelevel
- the enchantment level
-
removeStoredEnchantment
Removes a stored enchantment.- Parameters:
enchantment
- the enchantment type
-
getStoredEnchantmentLevel
Gets a stored enchantment level.- Parameters:
enchantment
- the enchantment type- Returns:
- the stored enchantment level, 0 if not present
-
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()
.
-