Class TranslatableComponent

    • Constructor Detail

      • 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()
    • Method Detail

      • 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​(StringBuilder builder)
      • toLegacyText

        protected void toLegacyText​(StringBuilder builder)
      • getFormat

        public Pattern getFormat()
      • 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