public interface TranslatableComponent extends BuildableComponent<TranslatableComponent,TranslatableComponent.Builder>, ScopedComponent<TranslatableComponent>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TranslatableComponent.Builder
A text component builder.
|
| Modifier and Type | Method and Description |
|---|---|
@NonNull java.util.List<Component> |
args()
Gets the unmodifiable list of translation arguments.
|
@NonNull TranslatableComponent |
args(@NonNull java.util.List<? extends Component> args)
Sets the translation arguments for this component.
|
static @NonNull TranslatableComponent.Builder |
builder()
Creates a translatable component builder.
|
static @NonNull TranslatableComponent.Builder |
builder(@NonNull java.lang.String key)
Creates a translatable component builder with a translation key.
|
@NonNull java.lang.String |
key()
Gets the translation key.
|
@NonNull TranslatableComponent |
key(@NonNull java.lang.String key)
Sets the translation key.
|
static @NonNull TranslatableComponent |
make(@NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
Creates a translatable component by applying configuration from
consumer. |
static @NonNull TranslatableComponent |
make(@NonNull java.lang.String key,
@NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
Creates a translatable component by applying configuration from
consumer. |
static @NonNull TranslatableComponent |
make(@NonNull java.lang.String key,
@NonNull java.util.List<? extends Component> args,
@NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
Creates a translatable component by applying configuration from
consumer. |
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key)
Creates a translatable component with a translation key.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
Component... args)
Creates a translatable component with a translation key and arguments.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@NonNull java.util.List<? extends Component> args)
Creates a translatable component with a translation key and arguments.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color)
Creates a translatable component with a translation key, and optional color.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
Component... args)
Creates a translatable component with a translation key, arguments, and optional color.
|
static TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
@NonNull java.util.List<? extends Component> args)
Creates a translatable component with a translation key, arguments, and optional color.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a translatable component with a translation key, and optional color and decorations.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations,
Component... args)
Creates a translatable component with a translation key, arguments, and optional color and decorations.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations,
@NonNull java.util.List<? extends Component> args)
Creates a translatable component with a translation key, arguments, and optional color and decorations.
|
static @NonNull TranslatableComponent |
of(@NonNull java.lang.String key,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a translatable component with a translation key, and optional color and decorations.
|
toBuilderappend, append, children, clickEvent, color, decoration, decoration, hoverEvent, insertion, mergeColor, mergeDecorations, mergeEventschildren, clickEvent, color, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, style, stylestatic @NonNull TranslatableComponent.Builder builder()
static @NonNull TranslatableComponent.Builder builder(@NonNull java.lang.String key)
key - the translation keystatic @NonNull TranslatableComponent of(@NonNull java.lang.String key)
key - the translation keystatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color)
key - the translation keycolor - the colorstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, TextDecoration... decorations)
key - the translation keycolor - the colordecorations - the decorationsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
key - the translation keycolor - the colordecorations - the decorationsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, Component... args)
key - the translation keyargs - the translation argumentsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, Component... args)
key - the translation keycolor - the colorargs - the translation argumentsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations, Component... args)
key - the translation keycolor - the colordecorations - the decorationsargs - the translation argumentsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @NonNull java.util.List<? extends Component> args)
key - the translation keyargs - the translation argumentsstatic TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, @NonNull java.util.List<? extends Component> args)
key - the translation keycolor - the colorargs - the translation argumentsstatic @NonNull TranslatableComponent of(@NonNull java.lang.String key, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations, @NonNull java.util.List<? extends Component> args)
key - the translation keycolor - the colordecorations - the decorationsargs - the translation argumentsstatic @NonNull TranslatableComponent make(@NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
consumer.consumer - the builder configuratorstatic @NonNull TranslatableComponent make(@NonNull java.lang.String key, @NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
consumer.key - the translation keyconsumer - the builder configuratorstatic @NonNull TranslatableComponent make(@NonNull java.lang.String key, @NonNull java.util.List<? extends Component> args, @NonNull java.util.function.Consumer<? super TranslatableComponent.Builder> consumer)
consumer.key - the translation keyargs - the translation argumentsconsumer - the builder configurator@NonNull java.lang.String key()
@NonNull TranslatableComponent key(@NonNull java.lang.String key)
key - the translation key@NonNull java.util.List<Component> args()
@NonNull TranslatableComponent args(@NonNull java.util.List<? extends Component> args)
args - the translation arguments