elements

fun Component.elements(lang: String = "en_us"): Sequence<StyledElement>

Flattens this Component into a sequence of StyledElements using the specified lang for translations.

Supported component types: TextComponent, TranslatableComponent, ObjectComponent. Other component types will be ignored.


fun Component.elements(translate: (key: String) -> String?, outerStyle: Style = Style.empty()): Sequence<StyledElement>

Flattens this Component into a sequence of StyledElements using the specified translate function for translations. An optional outerStyle can be provided to be merged with each element's style.

Supported component types: TextComponent, TranslatableComponent, ObjectComponent. Other component types will be ignored.