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

Singleplayer client discards synced biome tags


    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w06a
    • 24w04a, 24w05b
    • None
    • Confirmed
    • Networking
    • Important
    • Platform

      Since 24w04a, client discards all synced biome tags and other dynamic registry tags in singleplayer, causing them to not load. This does not affect multiplayer.

      Steps to Reproduce

      1. Start a singleplayer world with commands enabled.
      2. Open chat.
      3. Type /locate biome #.
      4. Observe that the tags do not get auto-completed.
      5. Type a valid tag name. In the video the tag used was without_wandering_trader_spawns.
      6. Observe that the "Can't find tag..." error appears above the chat.
      7. Send the command.
      8. Observe that the command gets successfully executed.

      Code analysis
      Minecraft has static registries - shared between singleplayer client and server - and dynamic registries, which are modifiable by data packs and synced to clients. Because static registries (and their tags) are shared and not synced in singleplayer, the tags for them need not be loaded from the server. However, dynamic registry tags must always be loaded from the server, as they are otherwise not shared to the client.

      RegistryDataCollector#collectGameRegistries loads the received dynamic registry entries and tags. Here, it only loads received tags in non-singleplayer mode (denoted by bl == true):

          if (this.tagCollector != null && !bl) {
            lv.get(ClientRegistryLayer.STATIC).registries().forEach(arg -> arg.value().resetTags());

            boq [Mojang] Bartosz Bok
            apple502j apple502j
            7 Vote for this issue
            8 Start watching this issue