Cloneable, ConfigurationSerializableBannerMeta, BlockStateMeta, BookMeta, EnchantmentStorageMeta, FireworkEffectMeta, FireworkMeta, KnowledgeBookMeta, LeatherArmorMeta, MapMeta, PotionMeta, SkullMeta, SpawnEggMeta, TropicalFishBucketMetapublic interface ItemMeta extends Cloneable, ConfigurationSerializable
An implementation will handle the creation and application for ItemMeta. This class should not be implemented by a plugin in a live environment.
| Modifier and Type | Interface | Description | 
|---|---|---|
| static class  | ItemMeta.Spigot | 
| Modifier and Type | Method | Description | 
|---|---|---|
| boolean | addAttributeModifier(Attribute attribute,
                    AttributeModifier modifier) | Add an Attribute and it's Modifier. | 
| boolean | addEnchant(Enchantment ench,
          int level,
          boolean ignoreLevelRestriction) | Adds the specified enchantment to this item meta. | 
| void | addItemFlags(ItemFlag... itemFlags) | Set itemflags which should be ignored when rendering a ItemStack in the Client. | 
| ItemMeta | clone() | |
| com.google.common.collect.Multimap<Attribute,AttributeModifier> | getAttributeModifiers() | Return an immutable copy of all Attributes and
 their modifiers in this ItemMeta. Returns null if none exist. | 
| Collection<AttributeModifier> | getAttributeModifiers(Attribute attribute) | Return an immutable copy of all  AttributeModifiers
 for a givenAttribute | 
| com.google.common.collect.Multimap<Attribute,AttributeModifier> | getAttributeModifiers(EquipmentSlot slot) | Return an immutable copy of all  Attributes and theirAttributeModifiers for a givenEquipmentSlot.Any AttributeModifierthat does have have a givenEquipmentSlotwill be returned. | 
| CustomItemTagContainer | getCustomTagContainer() | Returns a public custom tag container capable of storing tags on the
 item. | 
| String | getDisplayName() | Gets the display name that is set. | 
| int | getEnchantLevel(Enchantment ench) | Checks for the level of the specified enchantment. | 
| Map<Enchantment,Integer> | getEnchants() | Returns a copy the enchantments in this ItemMeta. | 
| Set<ItemFlag> | getItemFlags() | Get current set itemFlags. | 
| String | getLocalizedName() | Gets the localized display name that is set. | 
| List<String> | getLore() | Gets the lore that is set. | 
| boolean | hasAttributeModifiers() | Checks for the existence of any AttributeModifiers. | 
| boolean | hasConflictingEnchant(Enchantment ench) | Checks if the specified enchantment conflicts with any enchantments in
 this ItemMeta. | 
| boolean | hasDisplayName() | Checks for existence of a display name. | 
| boolean | hasEnchant(Enchantment ench) | Checks for existence of the specified enchantment. | 
| boolean | hasEnchants() | Checks for the existence of any enchantments. | 
| boolean | hasItemFlag(ItemFlag flag) | Check if the specified flag is present on this item. | 
| boolean | hasLocalizedName() | Checks for existence of a localized name. | 
| boolean | hasLore() | Checks for existence of lore. | 
| boolean | isUnbreakable() | Return if the unbreakable tag is true. | 
| boolean | removeAttributeModifier(Attribute attribute) | Remove all  AttributeModifiers associated with the givenAttribute. | 
| boolean | removeAttributeModifier(Attribute attribute,
                       AttributeModifier modifier) | Remove a specific  AttributeandAttributeModifier. | 
| boolean | removeAttributeModifier(EquipmentSlot slot) | Remove all  Attributes andAttributeModifiers for a
 givenEquipmentSlot.If the given EquipmentSlotis null, this will remove allAttributeModifiers that do not have an EquipmentSlot set. | 
| boolean | removeEnchant(Enchantment ench) | Removes the specified enchantment from this item meta. | 
| void | removeItemFlags(ItemFlag... itemFlags) | Remove specific set of itemFlags. | 
| void | setAttributeModifiers(com.google.common.collect.Multimap<Attribute,AttributeModifier> attributeModifiers) | Set all  Attributes and theirAttributeModifiers. | 
| void | setDisplayName(String name) | Sets the display name. | 
| void | setLocalizedName(String name) | Sets the localized name. | 
| void | setLore(List<String> lore) | Sets the lore for this item. | 
| void | setUnbreakable(boolean unbreakable) | Sets the unbreakable tag. | 
| ItemMeta.Spigot | spigot() | 
serializeboolean hasDisplayName()
@NotNull String getDisplayName()
 Plugins should check that hasDisplayName() returns true
 before calling this method.
void setDisplayName(@Nullable
                    String name)
name - the name to setboolean hasLocalizedName()
@NotNull String getLocalizedName()
 Plugins should check that hasLocalizedName() returns true
 before calling this method.
void setLocalizedName(@Nullable
                      String name)
name - the name to setboolean hasLore()
@Nullable List<String> getLore()
 Plugins should check if hasLore() returns true before
 calling this method.
void setLore(@Nullable
             List<String> lore)
lore - the lore that will be setboolean hasEnchants()
boolean hasEnchant(@NotNull
                   Enchantment ench)
ench - enchantment to checkint getEnchantLevel(@NotNull
                    Enchantment ench)
ench - enchantment to check@NotNull Map<Enchantment,Integer> getEnchants()
boolean addEnchant(@NotNull
                   Enchantment ench,
                   int level,
                   boolean ignoreLevelRestriction)
ench - Enchantment to addlevel - Level for the enchantmentignoreLevelRestriction - this indicates the enchantment should be
     applied, ignoring the level limitboolean removeEnchant(@NotNull
                      Enchantment ench)
ench - Enchantment to removeboolean hasConflictingEnchant(@NotNull
                              Enchantment ench)
ench - enchantment to testvoid addItemFlags(@NotNull
                  ItemFlag... itemFlags)
itemFlags - The hideflags which shouldn't be renderedvoid removeItemFlags(@NotNull
                     ItemFlag... itemFlags)
itemFlags - Hideflags which should be removed@NotNull Set<ItemFlag> getItemFlags()
boolean hasItemFlag(@NotNull
                    ItemFlag flag)
flag - the flag to checkboolean isUnbreakable()
void setUnbreakable(boolean unbreakable)
unbreakable - true if set unbreakableboolean hasAttributeModifiers()
@Nullable com.google.common.collect.Multimap<Attribute,AttributeModifier> getAttributeModifiers()
Multimap of Attributes
         and their AttributeModifiers, or null if none exist@NotNull com.google.common.collect.Multimap<Attribute,AttributeModifier> getAttributeModifiers(@NotNull EquipmentSlot slot)
Attributes and their
 AttributeModifiers for a given EquipmentSlot.AttributeModifier that does have have a given
 EquipmentSlot will be returned. This is because
 AttributeModifiers without a slot are active in any slot.slot - the EquipmentSlot to checkMultimap with the
         respective Attributes and modifiers, or an empty map
         if no attributes are set.@Nullable Collection<AttributeModifier> getAttributeModifiers(@NotNull Attribute attribute)
AttributeModifiers
 for a given Attributeattribute - the AttributeAttributeModifiers
          or null if no AttributeModifiers exist for the Attribute.NullPointerException - if Attribute is nullboolean addAttributeModifier(@NotNull
                             Attribute attribute,
                             @NotNull
                             AttributeModifier modifier)
EquipmentSlots.
 If not set, the AttributeModifier will be active in ALL slots.
 AttributeModifiers that have the same UUID
 cannot exist on the same Attribute.attribute - the Attribute to modifymodifier - the AttributeModifier specifying the modificationNullPointerException - if Attribute is nullNullPointerException - if AttributeModifier is nullIllegalArgumentException - if AttributeModifier already existsvoid setAttributeModifiers(@Nullable
                           com.google.common.collect.Multimap<Attribute,AttributeModifier> attributeModifiers)
Attributes and their AttributeModifiers.
 To clear all currently set Attributes and AttributeModifiers use
 null or an empty Multimap.
 If not null nor empty, this will filter all entries that are not-null
 and add them to the ItemStack.attributeModifiers - the new Multimap containing the Attributes
                           and their AttributeModifiersboolean removeAttributeModifier(@NotNull
                                Attribute attribute)
AttributeModifiers associated with the given
 Attribute.
 This will return false if nothing was removed.attribute - attribute to removeNullPointerException - if Attribute is nullboolean removeAttributeModifier(@NotNull
                                EquipmentSlot slot)
Attributes and AttributeModifiers for a
 given EquipmentSlot.EquipmentSlot is null, this will remove all
 AttributeModifiers that do not have an EquipmentSlot set.slot - the EquipmentSlot to clear all Attributes and
             their modifiers forboolean removeAttributeModifier(@NotNull
                                Attribute attribute,
                                @NotNull
                                AttributeModifier modifier)
Attribute and AttributeModifier.
 AttributeModifiers are matched according to their UUID.attribute - the Attribute to removemodifier - the AttributeModifier to removeNullPointerException - if the Attribute is nullNullPointerException - if the AttributeModifier is nullAttributeModifier.getUniqueId()@NotNull CustomItemTagContainer getCustomTagContainer()
@NotNull ItemMeta clone()
@NotNull ItemMeta.Spigot spigot()
Copyright © 2019. All rights reserved.