Interface EnumType.Displayable
public static interface EnumType.Displayable
An enum constant with its own name in the config screen, and optionally a description of what it does, shown as
a tooltip when choosing it from the list:
public enum Quality implements EnumType.Displayable {
LOW, HIGH;
public Component displayName() {
return Component.translatable("mymod.quality." + this.name().toLowerCase(Locale.ROOT));
}
public Component description() {
return Component.translatable("mymod.quality." + this.name().toLowerCase(Locale.ROOT) + ".desc");
}
}
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable net.minecraft.network.chat.ComponentWhat this constant does; null (the default) for none.net.minecraft.network.chat.Component
-
Method Details
-
displayName
net.minecraft.network.chat.Component displayName() -
description
@Nullable default @Nullable net.minecraft.network.chat.Component description()What this constant does; null (the default) for none.
-