Expose and forward decorated signed player chat through the Velocity API#1846
Draft
airgalaxie wants to merge 5 commits into
Draft
Expose and forward decorated signed player chat through the Velocity API#1846airgalaxie wants to merge 5 commits into
airgalaxie wants to merge 5 commits into
Conversation
Velocity already parses and validates signed Minecraft player chat internally, but PlayerChatEvent currently exposes only the player and plaintext message to plugins. Carry the original signed-message metadata across the public API boundary so ecosystem plugins can inspect modern Minecraft signed chat without depending on internal packet classes. This change is backward compatible and does not alter validation, forwarding, cancellation or rewrite behavior.
Make decorated player-chat forwarding atomic by preflighting every requested recipient and packet representation before any network write. Backend forwarding is now suppressed only when the proxy fully takes over delivery or when an empty recipient list intentionally delivers to nobody. Model clientbound chat-type parameters separately from the full decorated content, remove the implicit username sender binding, and keep empty recipient lists as an explicit routing result. Update tests with neutral data for atomic fallback, null delivery, final ChatResult behavior, defensive recipient copies, and explicit decoration parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Velocity parses and forwards modern Minecraft signed player chat internally,
but the public
PlayerChatEventAPI currently exposes only the player andthe plaintext message.
This pull request exposes the original protocol-level player chat metadata
through the public API and adds a general Velocity-managed path for delivering
server-decorated player chat to selected proxy players.
The implementation is not tied to a specific chat plugin. It provides a
general API foundation that plugins can use without accessing internal packet
classes or implementing version-specific Minecraft protocol handling.
Motivation
Modern Minecraft player chat is no longer just a plaintext string. Depending
on the protocol generation, it includes:
Velocity already processes much of this information internally, but plugins
cannot currently inspect or use it through
PlayerChatEvent.Command execution already exposes signed invocation state. Normal player chat
currently remains signature-blind at the public API boundary.
Changes
This pull request:
PlayerChatEventAPIProtocol support
metadata is exposed, but decorated signature-preserving emission is not
currently supported
versioned decorated player-chat emission
versioned emission including the protocol global index where required
Validation and limitations
Signed does not automatically mean validated.
The API distinguishes between metadata being present, structurally complete,
session-associated, and actually validated.
This change does not currently claim:
Unsupported protocol paths are reported explicitly. No silent system-chat
fallback is used.
Compatibility
Existing methods and constructors remain available:
PlayerChatEvent#getPlayer()PlayerChatEvent#getMessage()PlayerChatEvent#getResult()PlayerChatEvent#setResult(...)No internal or version-specific packet classes are exposed through
velocity-api.Tests
The following verification completed successfully:
Supersedes #1845, which targeted the previous development branch.