Interface LoreHolder

All Known Implementing Classes:
AstralArmorItem, AstralBlockItem, AstralItem, AstralPotionItem, BottleItem, BowlItem, ChocolateMilkItem, CloudyArmorItem, CloudyItem, DyeableCloudyArmorItem, DyedAmethystShardItem, MirrorItem, PlaceholderItem, PlaceholderMimicItem, RandomEffectItem, SprayBottleItem, SprayPotionItem

public interface LoreHolder
Provides common functionality for items that may contain lore tooltips.

By itself, this interface does not handle registration. It should usually be used in tandem with the Custom interface, which handles common registration as well.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default net.minecraft.text.Text
    formatLoreText(net.minecraft.text.MutableText lore)
    Formats the given mutable text instance to align with this item's preferred lore formatting.
    default List<net.minecraft.text.Text>
    getLoreTooltips(net.minecraft.item.ItemStack stack)
    Returns the lore tooltips assigned to the given item stack.
  • Method Details

    • formatLoreText

      default net.minecraft.text.Text formatLoreText(net.minecraft.text.MutableText lore)
      Formats the given mutable text instance to align with this item's preferred lore formatting.

      The default implementation simply makes the text gray. Any and all prior formatting will be preserved.

      Parameters:
      lore - The mutable text.
      Returns:
      A reference to the formatted text.
      Since:
      2.0.0
    • getLoreTooltips

      default List<net.minecraft.text.Text> getLoreTooltips(net.minecraft.item.ItemStack stack)
      Returns the lore tooltips assigned to the given item stack.

      By default, this method returns a list of tooltips assigned via the active language file. Keys are determined from ItemStack.getTooltip(net.minecraft.entity.player.PlayerEntity, net.minecraft.client.item.TooltipContext), with a `.lore_` suffix appended containing an integer identifier.

      This identifier will start at 0, incrementing by one until the language file no longer contains the computed key.

      Parameters:
      stack - The target item stack.
      Returns:
      A list of assigned tooltips.
      Since:
      2.0.0