Interface DisplayArg

All Known Implementing Classes:
DisplayArg.IntArg, DisplayArg.StringArg, DisplayArg.TranslationKeyArg

public sealed interface DisplayArg permits DisplayArg.StringArg, DisplayArg.IntArg, DisplayArg.TranslationKeyArg
Represents a single argument that can be used in dynamic keybind display strings. Supports typed arguments: STRING, INT, TRANSLATION_KEY, COMPONENT. Used in conjunction with DisplaySpec to provide dynamic values for translation key formatting.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    An integer argument.
    static final record 
    A string argument.
    static final record 
    A translation key argument (for nested translations).
  • Method Summary

    Modifier and Type
    Method
    Description
    static DisplayArg
    fromNbt(net.minecraft.nbt.CompoundTag tag)
    Deserialize a DisplayArg from NBT.
    int
    Get the type ID of this argument for serialization.
    Get the raw object value of this argument (String, Integer, etc).
    net.minecraft.nbt.CompoundTag
    Serialize this DisplayArg to NBT.
  • Method Details

    • toNbt

      net.minecraft.nbt.CompoundTag toNbt()
      Serialize this DisplayArg to NBT.
    • getTypeId

      int getTypeId()
      Get the type ID of this argument for serialization.
    • getValue

      Object getValue()
      Get the raw object value of this argument (String, Integer, etc).
    • fromNbt

      static DisplayArg fromNbt(net.minecraft.nbt.CompoundTag tag)
      Deserialize a DisplayArg from NBT.