Interface TranslatableComponent.Builder
- All Superinterfaces:
AbstractBuilder<TranslatableComponent>, ComponentBuilder<TranslatableComponent, TranslatableComponent.Builder>, ComponentBuilderApplicable, ComponentLike, MutableStyleSetter<TranslatableComponent.Builder>, StyleSetter<TranslatableComponent.Builder>
- Enclosing interface:
TranslatableComponent
public static sealed interface TranslatableComponent.Builder
extends ComponentBuilder<TranslatableComponent, TranslatableComponent.Builder>
A text component builder.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionarguments(List<? extends ComponentLike> args) Sets the translation args.arguments(ComponentLike... args) Sets the translation args.Sets the translation fallback text.Sets the translation key.default TranslatableComponent.Builderkey(Translatable translatable) Sets the translation key.Methods inherited from interface 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, styleMethods inherited from interface StyleSetter
shadowColor, shadowColorIfAbsent
-
Method Details
-
key
Sets the translation key.- Parameters:
translatable- the translatable object to get the key from- Returns:
- this builder
- Since:
- 4.8.0
-
key
Sets the translation key.- Parameters:
key- the translation key- Returns:
- this builder
- Since:
- 4.0.0
-
arguments
Sets the translation args.Non-
Componentarguments can be wrapped inTranslationArgument, or represented with aTranslationArgumentLike.- Parameters:
args- the translation args- Returns:
- this builder
- Since:
- 4.15.0
-
arguments
Sets the translation args.Non-
Componentarguments can be wrapped inTranslationArgument, or represented with aTranslationArgumentLike.- Parameters:
args- the translation args- Returns:
- this builder
- Since:
- 4.15.0
-
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
-