Interface AbstractItemTextPre_1_17


public interface AbstractItemTextPre_1_17
Interface providing version-specific implementations for item text and tooltip generation for Minecraft versions prior to 1.17.

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.

  • Method Summary

    Modifier and Type
    Method
    Description
    net.md_5.bungee.api.chat.BaseComponent[]
    Retrieves the text components that represent the item's display information.
    Retrieves the NBT-based string representation of the item's tooltip.
  • Method Details

    • getComponents

      net.md_5.bungee.api.chat.BaseComponent[] getComponents(ItemStack item)
      Retrieves the text components that represent the item's display information.

      This method extracts the BaseComponent array 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 - the ItemStack to extract components from
      Returns:
      an array of BaseComponent representing the item's display information
    • getNbtStringTooltip

      String getNbtStringTooltip(ItemStack item)
      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 - the ItemStack to extract tooltip NBT from
      Returns:
      the NBT string representation of the item's tooltip