Interface IotaHolderItem

All Known Implementing Classes:
ItemAbacus, ItemFocus, ItemScroll, ItemSlate, ItemSpellbook, ItemThoughtKnot

public interface IotaHolderItem
Items that store an iota to their tag can implement this interface.

On both the Forge and Fabric sides, the registry will be scanned for all items which implement this interface, and the appropriate cap/CC will be attached.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    If this key is set on the item, we ignore the rest of the item and render this as if it were of the IotaType given by the resource location.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    appendHoverText(IotaHolderItem self, net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> components, net.minecraft.world.item.TooltipFlag flag)
     
    boolean
    canWrite(net.minecraft.world.item.ItemStack stack, @Nullable Iota iota)
    Write null to indicate erasing
    default @Nullable Iota
    emptyIota(net.minecraft.world.item.ItemStack stack)
    What is this considered to contain when nothing can be read?
    default int
    getColor(net.minecraft.world.item.ItemStack stack)
     
    default @Nullable Iota
    readIota(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel world)
     
    @Nullable net.minecraft.nbt.CompoundTag
    readIotaTag(net.minecraft.world.item.ItemStack stack)
     
    boolean
    writeable(net.minecraft.world.item.ItemStack stack)
     
    void
    writeDatum(net.minecraft.world.item.ItemStack stack, @Nullable Iota iota)
    Write null to indicate erasing
  • Field Details

    • TAG_OVERRIDE_VISUALLY

      static final String TAG_OVERRIDE_VISUALLY
      If this key is set on the item, we ignore the rest of the item and render this as if it were of the IotaType given by the resource location.

      This is not useful to the player at all.

      See Also:
  • Method Details

    • readIotaTag

      @Nullable @Nullable net.minecraft.nbt.CompoundTag readIotaTag(net.minecraft.world.item.ItemStack stack)
    • readIota

      @Nullable default @Nullable Iota readIota(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel world)
    • emptyIota

      @Nullable default @Nullable Iota emptyIota(net.minecraft.world.item.ItemStack stack)
      What is this considered to contain when nothing can be read?
    • getColor

      default int getColor(net.minecraft.world.item.ItemStack stack)
    • writeable

      boolean writeable(net.minecraft.world.item.ItemStack stack)
      Returns:
      whether it is possible to write to this IotaHolder
    • canWrite

      boolean canWrite(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable Iota iota)
      Write null to indicate erasing
    • writeDatum

      void writeDatum(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable Iota iota)
      Write null to indicate erasing
    • appendHoverText

      static void appendHoverText(IotaHolderItem self, net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> components, net.minecraft.world.item.TooltipFlag flag)