Class Item.Tooltip

java.lang.Object
com.github.darksoulq.abyssallib.world.item.Item.Tooltip
Enclosing class:
Item

public static class Item.Tooltip extends Object
Internal class used to configure the visual representation of an item's tooltip.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Set<io.papermc.paper.datacomponent.DataComponentType>
    A set of vanilla component types that are explicitly hidden from the client display.
    List<net.kyori.adventure.text.Component>
    The list of Adventure Components representing the item's lore lines.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLine(net.kyori.adventure.text.Component component)
    Appends a new line of text to the tooltip lore.
    net.kyori.adventure.text.Component
    getLine(int index)
    Retrieves a specific line from the tooltip lore.
    net.kyori.adventure.key.Key
    Retrieves the currently assigned tooltip style Key.
    boolean
    Checks if the tooltip is currently set to be visible.
    void
    setVisible(boolean v)
    Sets whether the tooltip should be visible to players.
    void
    withHidden(io.papermc.paper.datacomponent.DataComponentType type)
    Marks a vanilla data component as hidden in the tooltip display.
    void
    withStyle(net.kyori.adventure.key.Key style)
    Assigns a custom style Key to the tooltip.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lines

      public List<net.kyori.adventure.text.Component> lines
      The list of Adventure Components representing the item's lore lines.
    • hiddenComponents

      public Set<io.papermc.paper.datacomponent.DataComponentType> hiddenComponents
      A set of vanilla component types that are explicitly hidden from the client display.
  • Constructor Details

    • Tooltip

      public Tooltip()
  • Method Details

    • setVisible

      public void setVisible(boolean v)
      Sets whether the tooltip should be visible to players.
      Parameters:
      v - True for visible, false for hidden.
    • withHidden

      public void withHidden(io.papermc.paper.datacomponent.DataComponentType type)
      Marks a vanilla data component as hidden in the tooltip display.
      Parameters:
      type - The Paper DataComponentType to hide.
    • addLine

      public void addLine(net.kyori.adventure.text.Component component)
      Appends a new line of text to the tooltip lore.
      Parameters:
      component - The Component text line to add.
    • withStyle

      public void withStyle(net.kyori.adventure.key.Key style)
      Assigns a custom style Key to the tooltip.
      Parameters:
      style - The Key representing the style.
    • getStyle

      public net.kyori.adventure.key.Key getStyle()
      Retrieves the currently assigned tooltip style Key.
      Returns:
      The assigned Key, or null.
    • isVisible

      public boolean isVisible()
      Checks if the tooltip is currently set to be visible.
      Returns:
      True if the tooltip is visible.
    • getLine

      public net.kyori.adventure.text.Component getLine(int index)
      Retrieves a specific line from the tooltip lore.
      Parameters:
      index - The line index.
      Returns:
      The Component at the given index.