mojira.dev
MC-269060

Item modifier can't copy to other components from storage

When using the item_modifiers in a datapack, you can't copy nbt from storage to other components than custom_data.

Before nbt was copied to the tag of the item. Now it is only copied to custom_data because copy_nbt does not exist anymore

storage "test": {CMD: 2}

item_modifiers/set_cmd.json :

Before

Now

Item:
/data get @s SelectedItem =

{... tag: {CustomModelData: 1}}

Item:
/data get @s SelectedItem.components =

{... "minecraft:custom_model_data": 1}
[
 {
  "function": "minecraft:copy_nbt",
  "source":{
   "type": "minecraft:storage",
   "source": "minecraft:test"
  },
  "ops": [
   {
    "source": "CMD",
    "target": "CustomModelData",
    "op": "replace"
   }
  ]
 }
]

Result:

/data get @s SelectedItem =

{... tag: {CustomModelData: 2}}
[
 {
  "function": "minecraft:copy_custom_data",
  "source":{
   "type": "minecraft:storage",
   "source": "minecraft:test"
  },
  "ops": [
   {
    "source": "CMD",
    "target": "custom_model_data",
    "op": "replace"
   }
  ]
 }
]

Result:

/data get @s SelectedItem.components =

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

 

Linked below are the 2 datapacks each corresponding with their mc version.
I created some click events with tellraw to easily see the process (also attached the images with the code & results)
In the datapack I set the target to "components.custom_model_data" but its still the same result.

Linked issues

Attachments

Comments 8

Please attach steps to reproduce this issue, including the expected and observed results.

How would I reproduce this? Are you able to attach a datapack that can be used to reproduce this bug?

Can confirm in 24w10a. This mucks up quite a few datapacks from 1.20.4 and prior.

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

This is not a feature request!

You were able to copy nbt to any item tag in the item modifiers! Now with the components, this has been overlooked and you only can copy to custom data instead of any tag/other components!

This is crucial to many datapacks! This was a feature and now its broken!

⚠️ Please do not add Affected Versions to resolved reports.

Have a look at the Resolution and the comments to see why this ticket has been resolved. If you think this ticket has been resolved erroneously you can contact the Mojira staff on Discord or Reddit.

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

god_of_sound

(Unassigned)

Community Consensus

Data Packs

components, item, modifiers

24w09a, 24w10a

Retrieved