Skip to content

Text Component API #43

Description

@SpaceWalkerRS

1.7 introduced the first version of the modern chat component system. It's a powerful way of constructing pieces of text with all kinds of formatting, colors, and even hover and click events. It would be incredibly useful to have in 1.6 and below, and even to backport modern features to 1.7-1.14.

Basic Features

  • Both translatable and literal text.
  • Legacy formatting codes (things like §1).

A basic implementation with these features can easily be serialized to legacy formatted text. The only snag is that before 1.6 text was translated server-side before being sent to the client. This behavior would need to be kept, at least for any Vanilla clients that are connected. It would be possible through custom payloads to send translatable text components to OSL clients that can handle the translation.

Custom Features (OXL)

  • Custom text colors.
  • Click events.
  • Hover events.

These features would require communication through custom payloads to work at all. They also need to be implemented client-side (particularly the click and hover events might be tricky).

Fancy Features

  • Allow mods to register their own custom click and hover events.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions