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 ClassesModifier and TypeInterfaceDescriptionstatic final recordAn integer argument.static final recordA string argument.static final recordA translation key argument (for nested translations). -
Method Summary
Modifier and TypeMethodDescriptionstatic DisplayArgfromNbt(net.minecraft.nbt.CompoundTag tag) Deserialize a DisplayArg from NBT.intGet the type ID of this argument for serialization.getValue()Get the raw object value of this argument (String, Integer, etc).net.minecraft.nbt.CompoundTagtoNbt()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
Deserialize a DisplayArg from NBT.
-