Enum XItemFlag

java.lang.Object
java.lang.Enum<XItemFlag>
com.cryptomorin.xseries.XItemFlag
All Implemented Interfaces:
XBase<XItemFlag,org.bukkit.inventory.ItemFlag>, Serializable, Comparable<XItemFlag>

public enum XItemFlag extends Enum<XItemFlag> implements XBase<XItemFlag,org.bukkit.inventory.ItemFlag>
  • Enum Constant Details

    • HIDE_ADDITIONAL_TOOLTIP

      @XInfo(since="1.20.4") @XChange(version="1.21", from="HIDE_POTION_EFFECTS", to="HIDE_ADDITIONAL_TOOLTIP") public static final XItemFlag HIDE_ADDITIONAL_TOOLTIP
      Setting to show/hide potion effects, book and firework information, map tooltips, patterns of banners.
      See Also:
    • HIDE_ARMOR_TRIM

      public static final XItemFlag HIDE_ARMOR_TRIM
      Armor trim names.
      See Also:
      • ArmorTrim
    • HIDE_ATTRIBUTES

      public static final XItemFlag HIDE_ATTRIBUTES
      See Also:
    • HIDE_DESTROYS

      public static final XItemFlag HIDE_DESTROYS
      Show or hide what block this item can break.

      This tag is used when making adventure maps to allow a specific tool/item to break a block. Apply the tag to any item/tool. If the value is not a valid block or item it displays as "missingno".

      Controlled by "CanDestroy" NBTTagList of NBTTagString of the block's namespaced material name. {CanDestroy:["minecraft:stone","#minecraft:logs","minecraft:player_head[rotation=8]{SkullOwner:{Name:'Dinnerbone'}}"]}

      Paper also provides its own API method for this from ItemMeta.setCanDestroy(Set<Material> canDestroy).

    • HIDE_DYE

      public static final XItemFlag HIDE_DYE
      Dye names for colored leather armors.
      See Also:
      • LeatherArmorMeta
    • HIDE_ENCHANTS

      public static final XItemFlag HIDE_ENCHANTS
      See Also:
    • HIDE_PLACED_ON

      public static final XItemFlag HIDE_PLACED_ON
      List of blocks that this item (must be a placeable block) can be placed on.

      This tag is used when making adventure maps to determine which block(s) the player can place a block on. Also used on hoes to make them till dirt and on spawn eggs to place them. If the value is not a valid block or item it displays as "missingno".

      Controlled by "CanPlaceOn" NBTTagList of NBTTagString of the block's namespaced material name. {CanPlaceOn:["minecraft:stone","#minecraft:logs","minecraft:player_head[rotation=8]{SkullOwner:{Name:'Dinnerbone'}}"]}

      Paper also provides its own API method for this from ItemMeta.setCanPlaceOn(Set<Material> canDestroy).

    • HIDE_STORED_ENCHANTS

      @XInfo(since="1.21.3") public static final XItemFlag HIDE_STORED_ENCHANTS
      Setting to show/hide stored enchants on an item, such as enchantments on an enchanted book. This functionality was split from HIDE_ADDITIONAL_TOOLTIP in v1.21.3

      Related links:

      See Also:
    • HIDE_UNBREAKABLE

      public static final XItemFlag HIDE_UNBREAKABLE
      This is not the same as XEnchantment.UNBREAKING enchant. For the blue "Unbreakable" text below attributes.
      See Also:
      • ItemMeta.setUnbreakable(boolean)
  • Field Details

    • REGISTRY

      public static final XRegistry<XItemFlag,org.bukkit.inventory.ItemFlag> REGISTRY
  • Method Details

    • values

      public static XItemFlag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static XItemFlag valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static XItemFlag of(org.bukkit.inventory.ItemFlag itemFlag)
    • of

      public static Optional<XItemFlag> of(String itemFlag)
    • getValues

      @NotNull public static @NotNull @Unmodifiable Collection<XItemFlag> getValues()
    • getNames

      public String[] getNames()
      Specified by:
      getNames in interface XBase<XItemFlag,org.bukkit.inventory.ItemFlag>
    • get

      @Nullable public @Nullable org.bukkit.inventory.ItemFlag get()
      Specified by:
      get in interface XBase<XItemFlag,org.bukkit.inventory.ItemFlag>
    • set

      public void set(org.bukkit.inventory.ItemStack item)
    • set

      public void set(org.bukkit.inventory.meta.ItemMeta meta)
    • removeFrom

      public void removeFrom(org.bukkit.inventory.ItemStack item)
    • removeFrom

      public void removeFrom(org.bukkit.inventory.meta.ItemMeta meta)
    • getFlags

      public Set<XItemFlag> getFlags(org.bukkit.inventory.ItemStack item)
    • getFlags

      public Set<XItemFlag> getFlags(org.bukkit.inventory.meta.ItemMeta meta)
    • has

      public boolean has(org.bukkit.inventory.ItemStack item)
    • has

      public boolean has(org.bukkit.inventory.meta.ItemMeta meta)
    • hideEverything

      public static void hideEverything(org.bukkit.inventory.meta.ItemMeta meta)
      Useful for decorative items.