mojira.dev
MC-279557

Item model minecraft:component select property can't check individual values inside of the minecraft:custom_data component

Description:
Item model minecraft:component select property can't check individual values inside of the minecraft:custom_data component

Expected Result:
The following item model should change the model of a golden sword when minecraft:custom_data contains {id:"COOL_SWORD"}, regardless of other data inside of minecraft:custom_data. (Similar to how /execute if data works)

{
  "model": {
    "type": "select",
    "property": "component",
    "component": "custom_data",
    "fallback": {
      "type": "model",
      "model": "item/golden_sword"
    },
    "cases": [
      {
        "when": "{id:\"COOL_SWORD\"}",
        "model": {
          "type": "model",
          "model": "item/cool_sword"
        }
      }
    ]
  }
}

Actual Result:
The entire component is checked instead of just the specified data

Steps to Reproduce:

   1. Enable the attached resource pack

   2. Run the following command:

/give @s minecraft:golden_sword[minecraft:custom_data={id:"COOL_SWORD"}]

   3. Notice the model is applied properly to the item

   4. Run the following command:

/give @s minecraft:golden_sword[minecraft:custom_data={id:"COOL_SWORD",extra_data:"yes"}]

   5. Notice the model is not applied to the item

   6. Drop the item without the custom model on the ground

   7. Run the following command:

/execute if data entity @n[type=minecraft:item] {Item:{components:{"minecraft:custom_data":{id:"COOL_SWORD"}}}}

   8. Notice the test passes

 

Attachments

Comments 1

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

ic22487

(Unassigned)

Confirmed

Resource Packs

25w03a

Retrieved