Enum Class XItemFlag
- All Implemented Interfaces:
XBase<XItemFlag,,org.bukkit.inventory.ItemFlag> Serializable,Comparable<XItemFlag>,Constable
ItemStack.
These are also known as HideFlags in Vanilla Minecraft.
You might find decorationOnly(ItemMeta) useful if you're using this for GUIs.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
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 TypeMethodDescriptionstatic voiddecorationOnly(@NotNull org.bukkit.inventory.meta.ItemMeta meta) This is mostly meant for items inside GUIs.@Nullable org.bukkit.inventory.ItemFlagget()getFlags(@NotNull org.bukkit.inventory.ItemStack item) getFlags(@NotNull org.bukkit.inventory.meta.ItemMeta meta) String[]getNames()static @NotNull @Unmodifiable Collection<XItemFlag> booleanhas(@NotNull org.bukkit.inventory.ItemStack item) booleanhas(@NotNull org.bukkit.inventory.meta.ItemMeta meta) static voidhideEverything(@NotNull org.bukkit.inventory.meta.ItemMeta meta) Deprecated.static @NotNull XItemFlagof(@NotNull org.bukkit.inventory.ItemFlag itemFlag) voidremoveFrom(@NotNull org.bukkit.inventory.ItemStack item) voidremoveFrom(@NotNull org.bukkit.inventory.meta.ItemMeta meta) voidset(@NotNull org.bukkit.inventory.ItemStack item) voidset(@NotNull org.bukkit.inventory.meta.ItemMeta meta) static XItemFlagReturns the enum constant of this class with the specified name.static XItemFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface com.cryptomorin.xseries.base.XBase
friendlyName, getMetadata, 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_ENCHANTMENTS
@XInfo(since="1.21.3") @XChange(version="1.21.5", from="HIDE_STORED_ENCHANTS", to="HIDE_STORED_ENCHANTMENTS") public static final XItemFlag HIDE_STORED_ENCHANTMENTSSetting 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:
-
HIDE_CUSTOM_DATA
-
HIDE_MAX_STACK_SIZE
-
HIDE_MAX_DAMAGE
-
HIDE_DAMAGE
-
HIDE_CUSTOM_NAME
-
HIDE_ITEM_NAME
-
HIDE_ITEM_MODEL
-
HIDE_LORE
-
HIDE_RARITY
-
HIDE_ENCHANTMENTS
-
HIDE_CAN_PLACE_ON
-
HIDE_CAN_BREAK
-
HIDE_ATTRIBUTE_MODIFIERS
-
HIDE_CUSTOM_MODEL_DATA
-
HIDE_TOOLTIP_DISPLAY
-
HIDE_REPAIR_COST
-
HIDE_CREATIVE_SLOT_LOCK
-
HIDE_ENCHANTMENT_GLINT_OVERRIDE
-
HIDE_INTANGIBLE_PROJECTILE
-
HIDE_FOOD
-
HIDE_CONSUMABLE
-
HIDE_USE_REMAINDER
-
HIDE_USE_COOLDOWN
-
HIDE_DAMAGE_RESISTANT
-
HIDE_TOOL
-
HIDE_WEAPON
-
HIDE_ENCHANTABLE
-
HIDE_EQUIPPABLE
-
HIDE_REPAIRABLE
-
HIDE_GLIDER
-
HIDE_TOOLTIP_STYLE
-
HIDE_DEATH_PROTECTION
-
HIDE_BLOCKS_ATTACKS
-
HIDE_DYED_COLOR
-
HIDE_MAP_COLOR
-
HIDE_MAP_ID
-
HIDE_MAP_DECORATIONS
-
HIDE_MAP_POST_PROCESSING
-
HIDE_CHARGED_PROJECTILES
-
HIDE_BUNDLE_CONTENTS
-
HIDE_POTION_CONTENTS
-
HIDE_POTION_DURATION_SCALE
-
HIDE_SUSPICIOUS_STEW_EFFECTS
-
HIDE_WRITABLE_BOOK_CONTENT
-
HIDE_WRITTEN_BOOK_CONTENT
-
HIDE_TRIM
-
HIDE_DEBUG_STICK_STATE
-
HIDE_ENTITY_DATA
-
HIDE_BUCKET_ENTITY_DATA
-
HIDE_BLOCK_ENTITY_DATA
-
HIDE_INSTRUMENT
-
HIDE_PROVIDES_TRIM_MATERIAL
-
HIDE_OMINOUS_BOTTLE_AMPLIFIER
-
HIDE_JUKEBOX_PLAYABLE
-
HIDE_PROVIDES_BANNER_PATTERNS
-
HIDE_RECIPES
-
HIDE_LODESTONE_TRACKER
-
HIDE_FIREWORK_EXPLOSION
-
HIDE_FIREWORKS
-
HIDE_PROFILE
-
HIDE_NOTE_BLOCK_SOUND
-
HIDE_BANNER_PATTERNS
-
HIDE_BASE_COLOR
-
HIDE_POT_DECORATIONS
-
HIDE_CONTAINER
-
HIDE_BLOCK_STATE
-
HIDE_BEES
-
HIDE_LOCK
-
HIDE_CONTAINER_LOOT
-
HIDE_BREAK_SOUND
-
HIDE_VILLAGER_VARIANT
-
HIDE_WOLF_VARIANT
-
HIDE_WOLF_SOUND_VARIANT
-
HIDE_WOLF_COLLAR
-
HIDE_FOX_VARIANT
-
HIDE_SALMON_SIZE
-
HIDE_PARROT_VARIANT
-
HIDE_TROPICAL_FISH_PATTERN
-
HIDE_TROPICAL_FISH_BASE_COLOR
-
HIDE_TROPICAL_FISH_PATTERN_COLOR
-
HIDE_MOOSHROOM_VARIANT
-
HIDE_RABBIT_VARIANT
-
HIDE_PIG_VARIANT
-
HIDE_COW_VARIANT
-
HIDE_CHICKEN_VARIANT
-
HIDE_FROG_VARIANT
-
HIDE_HORSE_VARIANT
-
HIDE_PAINTING_VARIANT
-
HIDE_LLAMA_VARIANT
-
HIDE_AXOLOTL_VARIANT
-
HIDE_CAT_VARIANT
-
HIDE_CAT_COLLAR
-
HIDE_SHEEP_COLOR
-
HIDE_SHULKER_COLOR
-
-
Field Details
-
REGISTRY
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
of
@NotNull public static @NotNull XItemFlag of(@NotNull @NotNull org.bukkit.inventory.ItemFlag itemFlag) -
of
-
getValues
-
getNames
-
get
@Nullable public @Nullable org.bukkit.inventory.ItemFlag get() -
set
@Contract(mutates="param1") public void set(@NotNull @NotNull org.bukkit.inventory.ItemStack item) -
set
@Contract(mutates="param1") public void set(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta) -
removeFrom
@Contract(mutates="param1") public void removeFrom(@NotNull @NotNull org.bukkit.inventory.ItemStack item) -
removeFrom
@Contract(mutates="param1") public void removeFrom(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta) -
getFlags
-
getFlags
-
has
@Contract(mutates="param1") public boolean has(@NotNull @NotNull org.bukkit.inventory.ItemStack item) -
has
@Contract(mutates="param1") public boolean has(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta) -
hideEverything
@Deprecated @Contract(mutates="param1") public static void hideEverything(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta) Deprecated.The name of this method is misleading as ofv1.21.5. UsedecorationOnly(ItemMeta)instead. -
decorationOnly
@Contract(mutates="param1") public static void decorationOnly(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta) This is mostly meant for items inside GUIs. It hides everything that would be considered redundant/metadata to show to the player. For example, the item attributes, blocks it can break/place, item id, etc. There are some rare cases where some of these attributes could be considered useful even in a GUI, but not in most cases when used as decoration.- Since:
- 13.2.0
-
v1.21.5.