Interface AbstractItemTextPre_1_17
- All Superinterfaces:
AbstractItemNbt
This interface handles the extraction of item display information and tooltips using the methods available in pre-1.17 Minecraft versions. It provides access to both component-based and NBT-based tooltip representations that were used before the major text component system changes in 1.17+.
The implementation focuses on compatibility with older text systems and provides methods for accessing item information in formats that were standard before the modern component system restructuring.
getItemId and getNbtTag are inherited from AbstractItemNbt, which the
1.17 and 1.18.1 modules also implement. They are declared there because an item hover needs them
on versions this interface does not cover.
-
Method Summary
Modifier and TypeMethodDescriptionnet.md_5.bungee.api.chat.BaseComponent[]getComponents(ItemStack item) Retrieves the text components that represent the item's display information.getNbtStringTooltip(ItemStack item) Retrieves the NBT-based string representation of the item's tooltip.Methods inherited from interface AbstractItemNbt
getItemId, getNbtTag
-
Method Details
-
getComponents
Retrieves the text components that represent the item's display information.This method extracts the
BaseComponentarray that represents how the item would be displayed in chat, tooltips, or other text contexts. The components include the item name, lore, enchantments, and other displayable properties formatted according to pre-1.17 standards.The returned components can be used for custom chat integration, hover text generation, or other display purposes where the full item representation is needed in component form.
- Parameters:
item- theItemStackto extract components from- Returns:
- an array of
BaseComponentrepresenting the item's display information
-
getNbtStringTooltip
Retrieves the NBT-based string representation of the item's tooltip.This method extracts the raw NBT string that represents the item's tooltip information as it would appear in-game. This includes all item properties, enchantments, lore, and metadata formatted as a string representation of the underlying NBT structure.
This method is useful for debugging, serialization, or when you need direct access to the raw tooltip data without component parsing. The returned string represents the complete tooltip structure in NBT format.
- Parameters:
item- theItemStackto extract tooltip NBT from- Returns:
- the NBT string representation of the item's tooltip
-