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

Item_modifiers copy_custom_data restricts nbt modification

XMLWordPrintable

    • Unconfirmed
    • (Unassigned)

      With item_modifiers in datapacks you could use copy_nbt to copy nbt from storage to any tag in an item.
      The replacement function copy_custom_data restricts this to only the ccustom_data component instead of any nbt on the item.

      example 1.20.4:
      You have a storage with data:

      {CMD; 2}

      You have an item with nbt: 

      {tag:{CustomModelData: 1}}

      With an item modifier you could copy from storage to item, thereby setting the CustomModelData to 2 from CMD
      Resulting the item with nbt: 

      {tag:{CustomModelData: 2}}

      example 24w10a:
      You have a storage with data: 

      {CMD; 2}

      You have an item with nbt: 

      {components:{"minecraft:custom_model_data": 1}}

      With an item modifier you try to copy from storage to item, you only set the custom_data component now
      Resulting the item with nbt: 

      {components:{"minecraft:custom_model_data": 1, "minecraft:custom_data":{custom_model_data: 2}}}

       

      Install the datapack to the correct version and click the text in order. Result is also shown in images. Image of code is also provided.

       

      This is not a feature request, this was an existing feature that now is broken and breaks a lot of datapacks because no item nbt except custom_data can be modified this way! see MC-269060 for more specific information. I may have failed at explaining the real issue there.

        1. code_1.20.4.png
          code_1.20.4.png
          121 kB
        2. bug MC-269060 24w09.zip
          88 kB
        3. bug MC-269060 1.20.4.zip
          75 kB
        4. screenshot-steps-1.20.4.png
          screenshot-steps-1.20.4.png
          73 kB
        5. code_24w09a.png
          code_24w09a.png
          131 kB
        6. screenshot-steps-24w09a.png
          screenshot-steps-24w09a.png
          86 kB

            Unassigned Unassigned
            god_of_sound god_of_sound
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: