Skip to content

Shadow Format Is Not Preserved In Components #1167

Open
@KillerCreeper112

Description

@KillerCreeper112

Describe the bug
When changing a chat message via a PacketListener and testing for SYSTEM_CHAT_MESSAGE, the "shadow" format of the text is not preserved. This may also be the case for other packets that use components but in my case, I specifically tested SYSTEM_CHAT_MESSAGE.

Software brand
This server is running Paper version 1.21.4-211-main@6ea4202 (2025-03-13T11:49:31Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-209-f0388e2 (MC: 1.21.4)

Plugins
LibsDisguises, FastAsyncWorldEdit, ProtocolLib, custom plugin

How To Reproduce

  1. Write a PacketListener that changes a message
@Override
    public void onPacketSend(PacketSendEvent event) {
        if(event.getPacketType() != PacketType.Play.Server.SYSTEM_CHAT_MESSAGE) return;
        WrapperPlayServerSystemChatMessage message = new WrapperPlayServerSystemChatMessage(event);
        Component msg = message.getMessage();
        msg = msg.replaceText(builder -> builder.matchLiteral("word").replacement("whoop"));
       message.setMessage(msg);
}
  1. Send a message that changes a text's shadow. In my case, I used:
    MiniMessage.miniMessage().deserialize("<!shadow>Test");
    to attempt to remove the text's shadow.

  2. Observe. The shadow format is completely ignored. In the example I used, the shadow still shows up even though it should not.

Expected behavior
The shadow format should persist in the message.

Screenshots
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions