Skip to content

NullPointerException when encoding 'clientbound/minecraft:set_title_text' packet (component is null) on Paper 26.2 #4922

Description

@BerndPixel

Server Implementation

Paper

Server Version

26.2

Describe the bug

After updating PlotSquared to the latest build for Paper 26.2, the console throws an EncoderException whenever PlotSquared tries to send a title to a player (e.g. when entering a plot).

The packet 'clientbound/minecraft:set_title_text' fails to encode because the Component passed to it is null:

java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.Component.tryCollapseToString()" because "component" is null

It looks like PlotSquared passes a null Component to the title packet instead of an empty Component (Component.empty()). Older Paper builds tolerated this, but the current build no longer accepts null components.

To Reproduce

  1. Run a Paper 26.2 server (build 26.2-112) with the latest PlotSquared v7 build.
  2. Join the server and enter/leave a plot, so that PlotSquared sends a plot title.
  3. Check the console: "Error sending packet clientbound/minecraft:set_title_text" with a NullPointerException is logged.

Expected behaviour

PlotSquared should never pass a null Component to the title packet. It should either send a valid (empty) Component or skip sending the packet entirely. No exception should be logged, and the title should display normally (or nothing should be shown if the title text is empty/disabled).

Screenshots / Videos

No response

Error log (if applicable)

https://gist.github.com/BerndPixel/57cb4ab465116bcc1b68ad0c0ff3e0cc

Plot Debugpaste

i dont get any message in Chat

PlotSquared Version

7.6.2

Checklist

Anything else?

Other plugins with packet injectors are installed (TAB, ProtocolLib, NoChatReports, AxGraves), but according to the stack trace they only pass the packet through their Netty pipeline - the null component originates from PlotSquared itself.

Current workaround: disabling titles in the PlotSquared config stops the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Requires TestingThis is a new issue which needs to be approved before labeled with "bug"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions