Enum XItemFlag
- All Implemented Interfaces:
XBase<XItemFlag,,org.bukkit.inventory.ItemFlag> Serializable,Comparable<XItemFlag>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSetting to show/hide potion effects, book and firework information, map tooltips, patterns of banners.Armor trim names.Show or hide what block this item can break.Dye names for colored leather armors.List of blocks that this item (must be a placeable block) can be placed on.Setting to show/hide stored enchants on an item, such as enchantments on an enchanted book.This is not the same asXEnchantment.UNBREAKINGenchant. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@Nullable org.bukkit.inventory.ItemFlagget()getFlags(org.bukkit.inventory.ItemStack item) getFlags(org.bukkit.inventory.meta.ItemMeta meta) String[]getNames()static @NotNull @Unmodifiable Collection<XItemFlag> booleanhas(org.bukkit.inventory.ItemStack item) booleanhas(org.bukkit.inventory.meta.ItemMeta meta) static voidhideEverything(org.bukkit.inventory.meta.ItemMeta meta) Useful for decorative items.static XItemFlagof(org.bukkit.inventory.ItemFlag itemFlag) voidremoveFrom(org.bukkit.inventory.ItemStack item) voidremoveFrom(org.bukkit.inventory.meta.ItemMeta meta) voidset(org.bukkit.inventory.ItemStack item) voidset(org.bukkit.inventory.meta.ItemMeta meta) static XItemFlagReturns the enum constant of this type with the specified name.static XItemFlag[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface com.cryptomorin.xseries.base.XBase
friendlyName, isSupported, name, or
-
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_TOOLTIPSetting to show/hide potion effects, book and firework information, map tooltips, patterns of banners.- See Also:
-
HIDE_ARMOR_TRIM
Armor trim names.- See Also:
-
HIDE_ATTRIBUTES
- See Also:
-
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
Dye names for colored leather armors.- See Also:
-
HIDE_ENCHANTS
- See Also:
-
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
Setting to show/hide stored enchants on an item, such as enchantments on an enchanted book. This functionality was split fromHIDE_ADDITIONAL_TOOLTIPin v1.21.3Related links:
- See Also:
-
HIDE_UNBREAKABLE
This is not the same asXEnchantment.UNBREAKINGenchant. For the blue "Unbreakable" text below attributes.- See Also:
-
-
Field Details
-
REGISTRY
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
of
-
of
-
getValues
-
getNames
-
get
@Nullable public @Nullable org.bukkit.inventory.ItemFlag get() -
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
-
getFlags
-
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.
-