Package io.papermc.paper.chat
Interface ChatRenderer
- All Known Subinterfaces:
ChatRenderer.Default
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A chat renderer is responsible for rendering chat messages sent by
Players to the server.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfaceSimilar toChatRenderer, but without knowledge of the message viewer. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatRendererCreate a new instance of the defaultChatRenderer.Renders a chat message.static ChatRendererviewerUnaware(ChatRenderer.ViewerUnaware renderer) Creates a new viewer-unawareChatRenderer, which will render the chat message a single time, displaying the same rendered message to every viewingAudience.
-
Method Details
-
render
@OverrideOnly Component render(Player source, Component sourceDisplayName, Component message, Audience viewer) Renders a chat message. This will be called once for each receivingAudience.- Parameters:
source- the message sourcesourceDisplayName- the display name of the source playermessage- the chat messageviewer- the receivingAudience- Returns:
- a rendered chat message
-
defaultRenderer
Create a new instance of the defaultChatRenderer.- Returns:
- a new
ChatRenderer
-
viewerUnaware
Creates a new viewer-unawareChatRenderer, which will render the chat message a single time, displaying the same rendered message to every viewingAudience.- Parameters:
renderer- the viewer unaware renderer- Returns:
- a new
ChatRenderer
-