Package net.kyori.adventure.text
Interface TranslatableComponent.Builder
- All Superinterfaces:
AbstractBuilder<TranslatableComponent>
,Buildable.Builder<TranslatableComponent>
,ComponentBuilder<TranslatableComponent,
,TranslatableComponent.Builder> ComponentBuilderApplicable
,ComponentLike
,MutableStyleSetter<TranslatableComponent.Builder>
,StyleSetter<TranslatableComponent.Builder>
- Enclosing interface:
- TranslatableComponent
public static interface TranslatableComponent.Builder
extends ComponentBuilder<TranslatableComponent,TranslatableComponent.Builder>
A text component builder.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull TranslatableComponent.Builder
args
(@NotNull List<? extends ComponentLike> args) Deprecated.default @NotNull TranslatableComponent.Builder
Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteaddefault @NotNull TranslatableComponent.Builder
args
(@NotNull ComponentBuilder<?, ?> arg) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteaddefault @NotNull TranslatableComponent.Builder
args
(@NotNull ComponentBuilder<?, ?> @NotNull ... args) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteaddefault @NotNull TranslatableComponent.Builder
args
(@NotNull ComponentLike @NotNull ... args) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
instead@NotNull TranslatableComponent.Builder
arguments
(@NotNull List<? extends ComponentLike> args) Sets the translation args.@NotNull TranslatableComponent.Builder
arguments
(@NotNull ComponentLike @NotNull ... args) Sets the translation args.@NotNull TranslatableComponent.Builder
Sets the translation fallback text.@NotNull TranslatableComponent.Builder
Sets the translation key.default @NotNull TranslatableComponent.Builder
key
(@NotNull Translatable translatable) Sets the translation key.Methods inherited from interface net.kyori.adventure.text.ComponentBuilder
append, append, append, append, append, append, appendNewline, appendSpace, applicableApply, apply, applyDeep, asComponent, build, children, clickEvent, color, colorIfAbsent, componentBuilderApply, decorate, decorate, decoration, decoration, decorationIfAbsent, decorations, decorations, font, hoverEvent, insertion, mapChildren, mapChildrenDeep, mergeStyle, mergeStyle, mergeStyle, resetStyle, style, style
Methods inherited from interface net.kyori.adventure.text.format.StyleSetter
shadowColor, shadowColorIfAbsent
-
Method Details
-
key
@Contract(pure=true) @NotNull default @NotNull TranslatableComponent.Builder key(@NotNull @NotNull Translatable translatable) Sets the translation key.- Parameters:
translatable
- the translatable object to get the key from- Returns:
- this builder
- Since:
- 4.8.0
-
key
@Contract("_ -> this") @NotNull @NotNull TranslatableComponent.Builder key(@NotNull @NotNull String key) Sets the translation key.- Parameters:
key
- the translation key- Returns:
- this builder
- Since:
- 4.0.0
-
args
@Deprecated @Contract("_ -> this") @NotNull default @NotNull TranslatableComponent.Builder args(@NotNull @NotNull ComponentBuilder<?, ?> arg) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteadSets the translation args.- Parameters:
arg
- the translation arg- Returns:
- this builder
- Since:
- 4.0.0
-
args
@Deprecated @Contract("_ -> this") @NotNull default @NotNull TranslatableComponent.Builder args(@NotNull @NotNull ComponentBuilder<?, ?> @NotNull ... args) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteadSets the translation args.- Parameters:
args
- the translation args- Returns:
- this builder
- Since:
- 4.0.0
-
args
@Deprecated @Contract("_ -> this") @NotNull default @NotNull TranslatableComponent.Builder args(@NotNull @NotNull Component arg) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteadSets the translation args.- Parameters:
arg
- the translation arg- Returns:
- this builder
- Since:
- 4.0.0
-
args
@Deprecated @Contract("_ -> this") @NotNull default @NotNull TranslatableComponent.Builder args(@NotNull @NotNull ComponentLike @NotNull ... args) Deprecated.for removal since 4.15.0, usearguments(ComponentLike...)
insteadSets the translation args.Non-
Component
arguments can be wrapped inTranslationArgument
, or represented with aTranslationArgumentLike
.- Parameters:
args
- the translation args- Returns:
- this builder
- Since:
- 4.0.0
-
args
@Deprecated @Contract("_ -> this") @NotNull default @NotNull TranslatableComponent.Builder args(@NotNull @NotNull List<? extends ComponentLike> args) Deprecated.for removal since 4.15.0, usearguments(List)
insteadSets the translation args.Non-
Component
arguments can be wrapped inTranslationArgument
, or represented with aTranslationArgumentLike
.- Parameters:
args
- the translation args- Returns:
- this builder
- Since:
- 4.0.0
-
arguments
@Contract("_ -> this") @NotNull @NotNull TranslatableComponent.Builder arguments(@NotNull @NotNull ComponentLike @NotNull ... args) Sets the translation args.Non-
Component
arguments can be wrapped inTranslationArgument
, or represented with aTranslationArgumentLike
.- Parameters:
args
- the translation args- Returns:
- this builder
- Since:
- 4.15.0
-
arguments
@Contract("_ -> this") @NotNull @NotNull TranslatableComponent.Builder arguments(@NotNull @NotNull List<? extends ComponentLike> args) Sets the translation args.Non-
Component
arguments can be wrapped inTranslationArgument
, or represented with aTranslationArgumentLike
.- Parameters:
args
- the translation args- Returns:
- this builder
- Since:
- 4.15.0
-
fallback
@Contract("_ -> this") @NotNull @NotNull TranslatableComponent.Builder fallback(@Nullable @Nullable String fallback) Sets the translation fallback text. The fallback text will be shown when the client doesn't know the translation key used in the translatable component.- Parameters:
fallback
- the fallback string- Returns:
- this builder
- Since:
- 4.13.0
- Since Minecraft:
- 1.19.4
-
arguments(List)
instead