Package net.md_5.bungee.api.chat

# Class TranslatableComponent

java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.TranslatableComponent

public final class TranslatableComponent extends BaseComponent

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class net.md_5.bungee.api.chat.BaseComponent

  `BaseComponent.LimitedStringVisitor, BaseComponent.StringVisitor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TranslatableComponent()`
  `TranslatableComponent(String translate, Object... with)`
  Creates a translatable component with the passed substitutions
  `TranslatableComponent(TranslatableComponent original)`
  Creates a translatable component from the original to clone it.
  `TranslatableComponent(TranslationProvider translatable, Object... with)`
  Creates a translatable component with the passed substitutions

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addWith(String text)`
  Adds a text substitution to the component.
  `void`
  `addWith(BaseComponent component)`
  Adds a component substitution to the component.
  `protected boolean`
  `canEqual(Object other)`
  `TranslatableComponent`
  `duplicate()`
  Creates a duplicate of this TranslatableComponent.
  `boolean`
  `equals(Object o)`
  `String`
  `getFallback()`
  The fallback, if the translation is not found
  `String`
  `getTranslate()`
  The key into the Minecraft locale files to use for the translation.
  `List<BaseComponent>`
  `getWith()`
  The components to substitute into the translation
  `int`
  `hashCode()`
  `void`
  `setFallback(String fallback)`
  The fallback, if the translation is not found
  `void`
  `setTranslate(String translate)`
  The key into the Minecraft locale files to use for the translation.
  `void`
  `setWith(List<BaseComponent> components)`
  Sets the translation substitutions to be used in this component.
  `protected void`
  `toLegacyText(BaseComponent.StringVisitor builder)`
  `protected void`
  `toPlainText(BaseComponent.StringVisitor builder)`
  `String`
  `toString()`

  ### Methods inherited from class net.md_5.bungee.api.chat.BaseComponent

  `addExtra, addExtra, applyStyle, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getClickEvent, getColor, getColorRaw, getExtra, getFont, getFontRaw, getHoverEvent, getInsertion, getShadowColor, getShadowColorRaw, getStyle, hasFormatting, hasStyle, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isReset, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setFont, setHoverEvent, setInsertion, setItalic, setObfuscated, setReset, setShadowColor, setStrikethrough, setStyle, setUnderlined, toLegacyText, toLegacyText, toPlainText, toPlainText`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### TranslatableComponent

    public TranslatableComponent(TranslatableComponent original)
    Creates a translatable component from the original to clone it.
    Parameters:
      `original` - the original for the new translatable component.

  - ### TranslatableComponent

    public TranslatableComponent(String translate, Object... with)
    Creates a translatable component with the passed substitutions
    Parameters:
      `translate` - the translation key
      `with` - the `String`s and `BaseComponent`s to use into the translation
    See Also:
      - `translate`
      - `setWith(java.util.List)`

  - ### TranslatableComponent

    public TranslatableComponent(TranslationProvider translatable, Object... with)
    Creates a translatable component with the passed substitutions
    Parameters:
      `translatable` - the translatable object
      `with` - the `String`s and `BaseComponent`s to use into the translation
    See Also:
      - `translate`
      - `setWith(java.util.List)`

  - ### TranslatableComponent

    public TranslatableComponent()

- ## Method Details

  - ### duplicate

    public TranslatableComponent duplicate()
    Creates a duplicate of this TranslatableComponent.
    Specified by:
      `duplicate` in class `BaseComponent`
    Returns:
      the duplicate of this TranslatableComponent.

  - ### setWith

    public void setWith(List<BaseComponent> components)
    Sets the translation substitutions to be used in this component. Removes any previously set substitutions
    Parameters:
      `components` - the components to substitute

  - ### addWith

    public void addWith(String text)
    Adds a text substitution to the component. The text will inherit this component's formatting
    Parameters:
      `text` - the text to substitute

  - ### addWith

    public void addWith(BaseComponent component)
    Adds a component substitution to the component. The text will inherit this component's formatting
    Parameters:
      `component` - the component to substitute

  - ### toPlainText

    protected void toPlainText(BaseComponent.StringVisitor builder)

  - ### toLegacyText

    protected void toLegacyText(BaseComponent.StringVisitor builder)

  - ### getTranslate

    public String getTranslate()
    The key into the Minecraft locale files to use for the translation. The text depends on the client's locale setting. The console is always en_US

  - ### getWith

    public List<BaseComponent> getWith()
    The components to substitute into the translation

  - ### getFallback

    public String getFallback()
    The fallback, if the translation is not found

  - ### setTranslate

    public void setTranslate(String translate)
    The key into the Minecraft locale files to use for the translation. The text depends on the client's locale setting. The console is always en_US

  - ### setFallback

    public void setFallback(String fallback)
    The fallback, if the translation is not found

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `BaseComponent`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `BaseComponent`

  - ### canEqual

    protected boolean canEqual(Object other)
    Overrides:
      `canEqual` in class `BaseComponent`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `BaseComponent`