Skip to content

Client unexpectedly disconnect due to Component with HoverEvent.showEntity #1577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Argon4W opened this issue May 25, 2025 · 0 comments · Fixed by #1578
Closed

Client unexpectedly disconnect due to Component with HoverEvent.showEntity #1577

Argon4W opened this issue May 25, 2025 · 0 comments · Fixed by #1578
Labels
type: bug Something isn't working

Comments

@Argon4W
Copy link
Contributor

Argon4W commented May 25, 2025

Expected Behavior

  1. Create a Component with a HoverEvent.showEntity().
  2. send it to a player connected to the proxy by player.sendMessage().
  3. The client of the player show the component in the chat correctly with the hover event.

Actual Behavior

Immediately after the message is sent. The client unexpectedly disconnected with a reason of internal exception occurred: JsonSyntaxException: Missing type, expected to find a string

Steps to Reproduce

Optional<Player> optional = proxyServer.getPlayer(...);
Component message = Component.text(...).hoverEvent(HoverEvent.showEntity(...));
optional.ifPresent(player -> player.sendMessage(message));

Plugin List

Only my plugin on the velocity and no plugins on the backend server.

Velocity Version

> velocity info
[22:50:17 INFO]: Velocity 3.4.0-SNAPSHOT (git-5eb83760-b506)
[22:50:17 INFO]: Copyright 2018-2023 Velocity Contributors。Velocity 以 GNU 通用公共许可证第三版授权。
[22:50:17 INFO]: PaperMC - GitHub

Additional Information

The client minecraft version is 1.20.1. Possible reason of this bug may be the PR #1564 that introduces support for new hover event schema in 1.21.5 controlled by JSONOptions.EMIT_HOVER_SHOW_ENTITY_KEY_AS_TYPE_AND_UUID_AS_ID. This option is FALSE by default which means it has to be explicitly set to true in the OptionSchema. However in the com.velocitypowered.proxy.protocol.ProtocolUtils only MODERN_SERIALIZER set that option to false explicitly , leaving all other serializers use the default value false, which may cause all versions prior to 1.21.5 to encounter same problem because the type key is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant