Interface IInformationProvider

All Known Implementing Classes:
DamageIndicatedItemFluidContainer

public interface IInformationProvider
Interface that can be applied to Block or Item so that they can provide information when the player hovers over the item in their inventory.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.ChatFormatting
    A prefix for blockState information.
    static final String
    A prefix for additional info.
    static final net.minecraft.ChatFormatting[]
    Additional info prefix styles
    static final net.minecraft.ChatFormatting
    A prefix for item information.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.network.chat.MutableComponent
    getInfo(net.minecraft.world.item.ItemStack itemStack)
    Get info for a given itemStack.
    void
    provideInformation(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, List<net.minecraft.network.chat.Component> list, net.minecraft.world.item.TooltipFlag flag)
    An extended way to provide additional information.
  • Field Details

    • BLOCK_PREFIX

      static final net.minecraft.ChatFormatting BLOCK_PREFIX
      A prefix for blockState information.
    • ITEM_PREFIX

      static final net.minecraft.ChatFormatting ITEM_PREFIX
      A prefix for item information.
    • INFO_PREFIX

      static final String INFO_PREFIX
      A prefix for additional info.
    • INFO_PREFIX_STYLES

      static final net.minecraft.ChatFormatting[] INFO_PREFIX_STYLES
      Additional info prefix styles
  • Method Details

    • getInfo

      net.minecraft.network.chat.MutableComponent getInfo(net.minecraft.world.item.ItemStack itemStack)
      Get info for a given itemStack.
      Parameters:
      itemStack - The itemStack that must be given information.
      Returns:
      Information for that itemStack.
    • provideInformation

      void provideInformation(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, List<net.minecraft.network.chat.Component> list, net.minecraft.world.item.TooltipFlag flag)
      An extended way to provide additional information.
      Parameters:
      itemStack - The itemStack that must be given information.
      world - The player that asks for information.
      list - The list of information.
      flag - The tooltip flag type.