Interface ItemElement

All Superinterfaces:
DomQueryable, Element, EventTarget, Node

public interface ItemElement extends Element
Represents an ItemStack element

 
 
  • Method Details

    • getTooltipHidden

      boolean getTooltipHidden()
      Get whether the element shows the automatically generated tooltip when hovered over or not.

      If getTooltip() does NOT return the automatically generated item tooltip, then the result of this method is ignored.

      Shorthand for parsing the value of the Attributes.ITEM_TOOLTIP_HIDE attribute. If the attribute is not set, false is returned. If the attribute's value cannot be parsed into a boolean, false is returned. Otherwise the parsed value of the attribute is returned.

      Returns:
      true, if the item tooltip is hidden, false otherwise.
      See Also:
    • setTooltipHidden

      void setTooltipHidden(boolean tooltipShown)
      Set whether the element shows the automatically generated tooltip when hovered over.

      Shorthand for setting the Attributes.ITEM_TOOLTIP_HIDE attribute.

      Parameters:
      tooltipShown - true, if the item tooltip is hidden, false otherwise.
      See Also:
    • getAdvancedTooltip

      boolean getAdvancedTooltip()
      Get whether the shown item's tooltip shows the advanced F3+H information.

      Shorthand for parsing the value of the Attributes.ADVANCED_ITEM_TOOLTIPS attribute. If the attribute is not set, then the value of Options.ADVANCED_ITEM_TOOLTIPS is used. If the option has no set value, then false is returned. If the attribute/option's value cannot be parsed into a boolean, false is returned, otherwise the parsed value is returned.

      Returns:
      true, if advanced tooltips are shown, false otherwise.
      See Also:
    • setAdvancedTooltip

      void setAdvancedTooltip(boolean advancedTooltip)
      Set whether the shown item's tooltip shows the advanced F3+H information.

      Shorthand for setting the Attributes.ADVANCED_ITEM_TOOLTIPS attribute.

      Parameters:
      advancedTooltip - true, to show advanced tooltips, false otherwise.
      See Also:
    • getTooltip

      Node getTooltip()
      Gets the element's tooltip.

      May return the item stack's tooltip, unless the element's tooltip has been overridden with Element.setTitleNode(Node) or if the Attributes.ITEM_TOOLTIP_HIDE has been set to true

      Specified by:
      getTooltip in interface Element
      Returns:
      Element tooltip
      See Also:
    • getItemStack

      @Nullable @Nullable org.bukkit.inventory.ItemStack getItemStack()
      Gets the element's item stack
      Returns:
      Item stack, or null, if not set or if it failed to load.
    • setItemStack

      void setItemStack(@Nullable @Nullable org.bukkit.inventory.ItemStack stack)
      Sets the element's item stack.
      Parameters:
      stack - Item tack.