You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Minecraft server can send a set title packet (https://wiki.vg/Protocol#Set_Title_Text) with its contents set as the String null and a 1.17.1 vanilla Java client will accept it with no errors. The Minecraft client (tested on 1.17.1 using a Fabric mod) deserializes the Component as literal null:
(Yarn mappings)
@Mixin(ClientPlayNetworkHandler.class)
publicclassClassNameLol {
@Inject(method = "onTitle", at = @At("HEAD"))
publicvoidonSetTitle(TitleS2CPacketpacket, CallbackInfoci) {
System.out.println(packet.getTitle()); // will be a literal null in this case
}
}
It appears that this just clears the title in Minecraft 1.17.1 - the same thing that the clear title packet does, except only for the title and not the subtitle.
This behavior can be seen with the BetterRTP plugin: https://www.spigotmc.org/resources/betterrtp-random-wild-teleport.36081/ . Installing the plugin and doing /rtp will show the issue to any Adventure deserializer listening on the client's packets. This can be replicated on Paper 1.16.5 by executing Player#sendTitle(null, ""). It does not manifest with Paper 1.17.1 build 259; it does manifest with Paper 1.16.5 [691 and 788] and https://ci.viaversion.com/job/ViaVersion/553/.
Adventure currently errors on this code as such:
com.google.gson.JsonParseException: Don't know how to turn null into a Component
at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.notSureHowToDeserialize(ComponentSerializerImpl.java:323)
at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:85)
at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:37)
at com.github.steveice10.mc.protocol.packet.ingame.server.title.ServerSetTitleTextPacket.read(ServerSetTitleTextPacket.java:22)
Tested with Adventure 4.9.1.
A Minecraft server can send a set title packet (https://wiki.vg/Protocol#Set_Title_Text) with its contents set as the String
null
and a 1.17.1 vanilla Java client will accept it with no errors. The Minecraft client (tested on 1.17.1 using a Fabric mod) deserializes the Component as literal null:(Yarn mappings)
It appears that this just clears the title in Minecraft 1.17.1 - the same thing that the clear title packet does, except only for the title and not the subtitle.
This behavior can be seen with the BetterRTP plugin: https://www.spigotmc.org/resources/betterrtp-random-wild-teleport.36081/ . Installing the plugin and doingThis can be replicated on Paper 1.16.5 by executing/rtp
will show the issue to any Adventure deserializer listening on the client's packets.Player#sendTitle(null, "")
. It does not manifest with Paper 1.17.1 build 259; it does manifest with Paper 1.16.5 [691 and 788] and https://ci.viaversion.com/job/ViaVersion/553/.Adventure currently errors on this code as such:
Source code: https://github.com/GeyserMC/MCProtocolLib/blob/feature/1.17.1/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/title/ServerSetTitleTextPacket.java#L22 which calls https://github.com/GeyserMC/MCProtocolLib/blob/feature/1.17.1/src/main/java/com/github/steveice10/mc/protocol/data/DefaultComponentSerializer.java#L8
It seems this was initially caused by #212 and its commit.
The text was updated successfully, but these errors were encountered: