Interface IInventoryItem

All Known Implementing Classes:
MinigunItem, ReinforcedChestBlock.ItemBlockReinforcedChest, SmartChestBlock.ItemBlockBlockSmartChest

public interface IInventoryItem
Implement this interface for your items that have an inventory. When you don't have access to the item, just create a class that implements this interface, and register an instance of it with IItemRegistry.registerInventoryItem(IInventoryItem). This will then will be used in the Pneumatic Helmet's item search and item tooltip generation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default net.minecraft.network.chat.Component
    Get a header for the inventory list, for tooltip purposes.
    static void
    getStacks(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks)
    Convenience implementation for getStacksInItem(ItemStack, List) for items have been dropped from a block entity block with serialized data.
    void
    getStacksInItem(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks)
     
    default String
    getTooltipPrefix(net.minecraft.world.item.ItemStack stack)
    A String to prepend to outputted tooltip lines.
  • Method Details

    • getStacksInItem

      void getStacksInItem(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks)
      Parameters:
      stack - Item that potentially has an inventory.
      curStacks - List of all currently added stacks for this item. Add more stacks in here in your implementation when found the right item.
    • getInventoryHeader

      default net.minecraft.network.chat.Component getInventoryHeader()
      Get a header for the inventory list, for tooltip purposes. Default return of null will not add any header.
      Returns:
      a header string (can be a translation string), or null for no header
    • getTooltipPrefix

      default String getTooltipPrefix(net.minecraft.world.item.ItemStack stack)
      A String to prepend to outputted tooltip lines. Can be used to apply colouring, for example.
      Parameters:
      stack - the itemstack currently being added to the tooltip
      Returns:
      a string prefix
    • getStacks

      static void getStacks(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks)
      Convenience implementation for getStacksInItem(ItemStack, List) for items have been dropped from a block entity block with serialized data.
      Parameters:
      stack - the stack
      curStacks - a list of stacks to fill