Skip to content

Signed messages never have any chat type format in the console #13738

@Strokkur424

Description

@Strokkur424

Note

EDIT: This does not work for built-in chat types either. The same behavior can be observed using ChatType.CHAT, however I already spent so much time writing this issue up for custom ones, I will just keep them.

Expected behavior

When I run a method of type

Audience.sendMessage(SignedMessage, ChatType.Bound);

I expect to see the translation key format of my datapack-registered chat type to render in the same (or similar) way to how the client would render it. This already works well for the built-in chat types.

Observed/Actual behavior

The format is displayed correctly in the player's chat:

Image

However the console simply prints out the signed message's content without any attempt made at formatting:

[20:17:36 INFO]: Strokkur24 issued server command: /broadcast This is a very cool broadcast
[20:17:36 INFO]: This is a very cool broadcast

Steps/models to reproduce

Register a new chat type example:broadcast:

{
  "chat": {
    "parameters": [
      "sender",
      "content"
    ],
    "translation_key": "%s %s"
  },
  "narration": {
    "parameters": [
      "target",
      "content"
    ],
    "translation_key": "%s sent a broadcast: %s"
  }
}

Obtain the Adventure ChatType instance:

private static final ChatType CHAT_TYPE_BROADCAST = ChatType.chatType(Key.key("example:broadcast"));

Send a signed message using that chat type to an audience containing both a player and the console command sender:

private void broadcast(CommandSender sender, SignedMessage signedMessage) {
  final Component format = MiniMessage.miniMessage().deserialize(
    "<b><gradient:dark_red:red>BROADCAST</b> <sender> <dark_gray>»</dark_gray>",
    Placeholder.component("sender", sender.name())
  );

  broadcastAudience.sendMessage(signedMessage, CHAT_TYPE_BROADCAST.bind(format, sender.name()));
}

Full example code can be viewed at https://github.com/Strokkur424/paper-cookbook/tree/247514b9aa93b950aa04c8ceacac8a564e6ca3bc/examples/22-chat-type/src/main/java/net/strokkur/paper/cookbook/chattype.

Plugin and Datapack List

plugins
[20:26:37 INFO]: ℹ Server Plugins (1):
[20:26:37 INFO]: Paper Plugins:
[20:26:37 INFO]:  - chat-type


datapack list
[20:27:49 INFO]: There are 4 data pack(s) enabled: [vanilla (built-in)], [chat-type/provided (plugin)], [file/bukkit (world)], [paper (built-in)]
[20:27:49 INFO]: There are no more data packs available

Paper version

version
[20:28:15 INFO]: Checking version, please wait...
[20:28:15 INFO]: This server is running Paper version 1.21.11-127-main@bd74bf6 (2026-03-10T02:55:23Z) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
You are running the latest version

Other

I have a fully working example under https://github.com/Strokkur424/paper-cookbook/tree/247514b9aa93b950aa04c8ceacac8a564e6ca3bc/examples/22-chat-type. You can clone that repository and run ./gradlew :chat-type:runServer to instantly start a test server where this behavior can be observed (/broadcast required operator permissions, just op yourself in the console)

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions