Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-267103

Client crashes when receiving inconsistent network registries

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.5 Pre-Release 2
    • 1.20.3 Pre-Release 4
    • None
    • Plausible
    • Crash, Networking
    • Normal
    • Platform

      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:

      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 and ClientboundLevelChunkWithLightPacket for biomes
      • ClientboundDamageEventPacket for damage types
      • ClientboundLoginPacket and ClientboundRespawnPacket 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:

      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.

            Unassigned Unassigned
            WinX64 WinX64
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: