Skip to content

fix: keep hover and click events in chat converted on 1.8.9 - #1291

Open
Hexze wants to merge 1 commit into
Polyfrost:v1from
Hexze:fix/legacy-chat-json
Open

Hexze wants to merge 1 commit into
Polyfrost:v1from
Hexze:fix/legacy-chat-json

Conversation

@Hexze

@Hexze Hexze commented Nov 3, 2026

Copy link
Copy Markdown

Description

On 1.8.9, FabricClientAudiences serializes with GsonComponentSerializer.gson(), which writes hover_event/click_event. 1.8.9 only reads hoverEvent/clickEvent, so hover and click events are dropped from converted chat messages. This switches it to colorDownsamplingGson(), which writes the format 1.8.9 reads.

Checklist

  • I made a clear description of what was changed
  • I stated why these changes were necessary
  • I updated documentation or said what needs to be updated
  • I made sure these changes are backwards compatible
  • This pull request is for one feature/bug fix

@lunaynx
lunaynx force-pushed the fix/legacy-chat-json branch from 7333116 to 6f604a2 Compare November 3, 2026 01:54

public Text toNative(Component component) {
return Text.Serializer.fromJson(GsonComponentSerializer.gson().serialize(component));
return Text.Serializer.fromJson(LEGACY_JSON.serialize(component));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 [P1] Preserve messages with unsupported hover content

On 1.8.9, a text component whose show_text hover contains Component.keybind("key.jump") now throws JsonParseException: the new serializer exposes the nested keybind to a parser that does not support it. Previously, the label rendered while the hover was ignored. The exception reaches chat display and UI text resolution and can crash the client. Fall back to compatible hover content or preserve the label when conversion fails.

Comment thread CHANGELOG.md
@@ -1,2 +1,3 @@
## Unreleased changes
- Fixed hover and click events being dropped from chat messages that OneConfig converts on 1.8.9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 [P3] Qualify the release note

Item and entity hovers are still dropped because the selected serializer does not emit their legacy payloads by default. That limitation predates this change, but the new entry suggests converted hover events are fixed generally. Narrow the claim or add support for those hover types.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants