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

Banner pattern entries without colors are invalidated when upgrading to 1.20.5

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Future Update
    • 24w09a, 1.20.5, 1.20.6
    • None
    • Confirmed
    • Datafixer
    • Important
    • Platform

      In Minecraft 1.20.4, banner pattern entries without a color would default to white. For example, the following command would produce a black banner with a 'White Base Dexter Canton' pattern:

      /give @s black_banner{BlockEntityTag:{Patterns:[{Pattern:"bl"}]}}
      

      Upon upgrading to Minecraft 1.20.5, this pattern entry is removed from the banner in its block and item forms. I would expect the pattern to remain, including with the white color, as data loss is not expected between upgrades. Note that previous issues of this class have been considered valid, such as MC-268854 for firework rocket's Type.

      This issue seems to be caused by the data fixer not setting a default color, meaning the data is invalidated in component serialization/deserialization.

      The input NBT from 1.20.4 is:

      {
      	"id": "minecraft:black_banner",
      	"Count": 1,
      	"tag": {
      		"BlockEntityTag": {
      			"Patterns": [{
      				"Pattern": "bl"
      			}]
      		}
      	}
      }
      

      This NBT gets upgraded to the following in 1.20.5:

      {
      	"count": 1,
      	"components": {
      		"minecraft:banner_patterns": [{
      			"pattern": "minecraft:square_bottom_left"
      		}]
      	},
      	"id": "minecraft:black_banner"
      }
      

      When parsing, an exception is thrown due to the color key being missing:

      java.lang.IllegalStateException: No key color in MapLike[{pattern:"minecraft:square_bottom_left"}]; Not a map: "minecraft:square_bottom_left" missed input: {"minecraft:banner_patterns":[{pattern:"minecraft:square_bottom_left"}
      

            gegy1000 [Mojang] Gegy
            haykam haykam
            Votes:
            5 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: