Class Item.Tooltip
java.lang.Object
com.github.darksoulq.abyssallib.world.item.Item.Tooltip
- Enclosing class:
Item
Internal class used to configure the visual representation of an item's tooltip.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLine(net.kyori.adventure.text.Component component) Appends a new line of text to the tooltip lore.net.kyori.adventure.text.ComponentgetLine(int index) Retrieves a specific line from the tooltip lore.net.kyori.adventure.key.KeygetStyle()Retrieves the currently assigned tooltip style Key.booleanChecks if the tooltip is currently set to be visible.voidsetVisible(boolean v) Sets whether the tooltip should be visible to players.voidwithHidden(io.papermc.paper.datacomponent.DataComponentType type) Marks a vanilla data component as hidden in the tooltip display.voidwithStyle(net.kyori.adventure.key.Key style) Assigns a custom style Key to the tooltip.
-
Field Details
-
lines
The list of AdventureComponents representing the item's lore lines.
-
-
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 PaperDataComponentTypeto hide.
-
addLine
public void addLine(net.kyori.adventure.text.Component component) Appends a new line of text to the tooltip lore.- Parameters:
component- TheComponenttext line to add.
-
withStyle
public void withStyle(net.kyori.adventure.key.Key style) Assigns a custom style Key to the tooltip.- Parameters:
style- TheKeyrepresenting 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
Componentat the given index.
-