Interface Tooltippable

All Known Implementing Classes:
BlockEntityMixin

public interface Tooltippable
Interface for components that can have a tooltip displayed when hovered over in-world
Since:
1.0.0
See Also:
  • Method Details

    • getTooltip

      List<net.minecraft.network.chat.Component> getTooltip()
      Get the tooltip components from the block entity
      Returns:
      the tooltip components
    • isTooltipEnabled

      boolean isTooltipEnabled()
    • saveTooltipData

      net.minecraft.nbt.CompoundTag saveTooltipData()
    • loadTooltipData

      void loadTooltipData(net.minecraft.nbt.CompoundTag tag)
    • setTooltip

      void setTooltip(List<net.minecraft.network.chat.Component> tooltip)
      Set the tooltip components for the block entity
      Parameters:
      tooltip - the tooltip components to set
    • addTooltip

      void addTooltip(net.minecraft.network.chat.Component tooltip)
      Add a tooltip component to the block entity
      Parameters:
      tooltip -
    • addTooltip

      void addTooltip(List<net.minecraft.network.chat.Component> tooltip)
      Add a list of tooltip components to the block entity
      Parameters:
      tooltip -
    • addTooltip

      void addTooltip(String tooltip)
      Add a tooltip component to the block entity
      Parameters:
      tooltip -
    • getTheme

      ColorTheme getTheme()
      Get the theme object for the tooltip from the block entity
      Returns:
      the theme object
      See Also:
    • setTheme

      void setTheme(ColorTheme theme)
      Set the theme object for the tooltip from the block entity
      Parameters:
      theme - the theme object to set
    • setBackgroundColor

      void setBackgroundColor(int color)
      Set the background color of the theme
      Parameters:
      color - the color to set
    • setTopBorderColor

      void setTopBorderColor(int color)
      Set the top border color of the theme
      Parameters:
      color -
    • setBottomBorderColor

      void setBottomBorderColor(int color)
      Set the bottom border color of the theme
      Parameters:
      color -
    • getWorldspace

      boolean getWorldspace()
      Whether the tooltip should be rendered in worldspace or not
      Returns:
      true if the tooltip should be rendered in worldspace, false if it should be rendered in screenspace
    • getTimeline

      TooltipTimeline getTimeline()
      Obtain the timeline for the tooltip
      Returns:
      the timeline
    • getStack

      net.minecraft.world.item.ItemStack getStack()
      The stack for the tooltip to take components from
      Returns:
      the stack
    • getTooltipWidth

      int getTooltipWidth()
      Increase the tooltip width
      Returns:
      the bonus width
    • getTooltipHeight

      int getTooltipHeight()
      Increase the tooltip height
      Returns:
      the bonus height
    • getTooltipXOffset

      int getTooltipXOffset()
      Get the x offset for the tooltip
      Returns:
    • getTooltipYOffset

      int getTooltipYOffset()
      Get the y offset for the tooltip
      Returns:
    • getItems

      Get the items to render in the tooltip and data about them
      Returns:
      the items