PaperMC / PaperMC/Paper

Using defaultRenderer causes unexpected result in AsyncChatEvent

Open
#13,574 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted version: 1.21.11
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When setting the renderer in an AsyncChatEvent to ChatRenderer.defaultRenderer(), it should render in the default format. This is typically something like <APickledWalrus> hello world!.

Observed/Actual behavior

When the renderer is set, the output instead contains the player name twice:

Image
Steps/models to reproduce

I ran a server will only the following test plugin:

import io.papermc.paper.chat.ChatRenderer;
import io.papermc.paper.event.player.AsyncChatEvent;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class TestPlugin extends JavaPlugin implements Listener {

	@Override
	public void onEnable() {
		Bukkit.getPluginManager().registerEvents(this, this);
	}

	@EventHandler
	public void onChat(AsyncChatEvent event) {
		event.renderer(ChatRenderer.defaultRenderer());
	}

}
Plugin and Datapack List
> plugins
[20:31:18 INFO]: ℹ Server Plugins (1):
[20:31:18 INFO]: Paper Plugins:
[20:31:18 INFO]:  - PickleTest
> datapack list
[20:31:30 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[20:31:30 INFO]: There are no more data packs available
Paper version
> version
[20:31:49 INFO]: Checking version, please wait...
[20:31:49 INFO]: This server is running Paper version 1.21.11-99-main@81b9122 (2026-01-20T19:08:30Z) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.11-51-90191f7 (MC: 1.21.11)
Other

This appears to be an issue with one of the internal checks for whether the renderer being used is the default renderer.

I manually used the implementation of ChatRenderer.defaultRenderer(), which works as expected.

event.renderer(ChatRenderer.viewerUnaware((source, sourceDisplayName, message) ->
    Component.translatable("chat.type.text", sourceDisplayName, message)))

The difference here is that it is just a regular ViewerUnaware renderer, not a Default renderer.

This line stands out to me, but I have zero familiarity with Paper internals here:
https://github.com/PaperMC/Paper/blob/81b9122470121035de76325592a9cf84208fac55/paper-server/src/main/java/io/papermc/paper/adventure/ChatProcessor.java#L189

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at paper-server/src/main/java/io/papermc/paper/adventure/ChatProcessor.java around line 189 and compare the default renderer path with the viewer-unaware implementation shown in the issue. Reproduce the behavior with the provided AsyncChatEvent test plugin, then verify that ChatRenderer.defaultRenderer() produces the default format without duplicating the player name.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.