The network registries compose the data that is sent to the client via ClientboundRegistryDataPacket
during the configuration phase, the six of them being:
minecraft:trim_material
minecraft:trim_pattern
minecraft:worldgen/biome
minecraft:chat_type
minecraft:damage_type
minecraft:dimension_type
There are currently three issues with how they are handled on the client, all of them causing it to crash. They are as follows:
Server not sending all the required registries
The client will attempt to access every one of the six registries, regardless if they were sent by the server or not. If the registry wasn't sent by the server, the client crashes:
[media]
Server not sending all the required registry entries
For the minecraft:worldgen/biome
and minecraft:damage_type
registries, the client expects specific entries to be present, and will try to access them whether they are or not. If they weren't sent by the server, the client crashes.
For minecraft:worldgen/biome
, it is the entry by the name of minecraft:plains
.
For minecraft:damage_type
, they are the entries accessed in the constructor of DamageSources
, or the entries by the names of:
minecraft:in_fire
minecraft:lightning_bolt
minecraft:on_fire
minecraft:lava
minecraft:hot_floor
minecraft:in_wall
minecraft:cramming
minecraft:drown
minecraft:starve
minecraft:cactus
minecraft:fall
minecraft:fly_into_wall
minecraft:out_of_world
minecraft:generic
minecraft:magic
minecraft:wither
minecraft:dragon_breath
minecraft:dry_out
minecraft:sweet_berry_bush
minecraft:freeze
minecraft:stalagmite
minecraft:outside_border
minecraft:generic_kill
Server sending references to non-existent registry entries
The entries for the minecraft:worldgen/biome
, minecraft:damage_type
and minecraft:dimension_type
registries are referenced in other parts of the protocol, namely the following packets:
ClientboundChunksBiomesPacket
andClientboundLevelChunkWithLightPacket
for biomesClientboundDamageEventPacket
for damage typesClientboundLoginPacket
andClientboundRespawnPacket
for dimension types
If an entry that isn't present in the network registries is referenced in any of the packets above, the client will crash upon receiving said packet:
[media][media]
[media]
Conversely, a similar situation happens with the minecraft:chat_type
registry and both ClientboundDisguisedChatPacket
and ClientboundPlayerChatPacket
packets. However, the client instead disconnects gracefully from the server with a multiplayer.disconnect.invalid_packet
message instead of hard crashing, which was perhaps the intended behavior for the others?
As far as I am aware, these situations will never happen with the Vanilla server, but only with a modded one where the registries have been specifically crafted. It does however, always affect and crash the Vanilla client regardless.
Attachments
Comments 4
Made the issue more generalized, tackling two closely related problems regarding the network registries.
Added the crash-logs for each case. They could be relevant as the crashes were triggered in six distinct parts of the code.
From how it's described, it seems possible to reproduce this with a data pack that disables said registries (via the block list in pack.mcmeta).
Might want to check that.
Perhaps a good idea to note which IDs have to exist.