mojira.dev
MC-272893

Advancements: `components` requires exact match with target rather then specific tag

the following advancement should trigger when a player picks up a bucket of tropical fish with the `BucketVariantTag` set to `67502593`:

 

{
  "display": {
    "icon": {
      "id": "minecraft:warped_fungus",
      "count": 1
    },
    "title": {
      "text": "triggered"
    },
    "description": {
      "translate": "advancements.husbandry.tactical_fishing.description"
    }
  },
  "parent": "minecraft:husbandry/fishy_business",
  "criteria": {
    "tropical_fish_bucket": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": "minecraft:tropical_fish_bucket",
            "components": {
              "minecraft:bucket_entity_data": {
                "BucketVariantTag":67502593
              }
            }
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "tropical_fish_bucket"
    ]
  ],
  "sends_telemetry_event": false
}

However it doesn't work because the components needs an exact match as most naturally caught tropical fish would have a health tag, an exact match can be created with 

/give @s minecraft:tropical_fish_bucket[minecraft:bucket_entity_data={BucketVariantTag:67502593}]

This is because the components need to match exactly, the current system doesn't allow for selective tag matching, previous verions would allow for specific tag matching with 

"trigger": "minecraft:inventory_changed",
"conditions": {
    "items": [
        {
            "items": [
                "minecraft:tropical_fish_bucket"
            ],
            "nbt": "{BucketVariantTag: 67502593}"
        }
    ]
}

this is now missing functionality caused form the component system

 

How to reproduce:

  1. Add datapack-BucketVariantTag.tag to a world

  2. Spawn a tropical fish with `BucketVariantTag` set to 67502593

  3. Catch the fish in a water bucket and that should trigger the advancement but it won't

  4. if you use the following command it will give you a tropical fish bucket where the "minecraft:bucket_entity_data" component is composed solely of the BucketVariantTag

    /give @s minecraft:tropical_fish_bucket[minecraft:bucket_entity_data={BucketVariantTag:67502593}]
  1. if you now place that fish in water

  2. clear you advancements

  3. pick the fish in a bucket it will no longer trigger the advancement as it now ill hvae a health tag inside the "minecraft:bucket_entity_data" tag

 

Expected result:

  1. the advancement should trigger when a fish with the "BucketVariantTag" of 67502593 is caught

Actual result:

  1. the advancements do not trigger unless the "BucketVariantTag" is the only tag in "minecraft:bucket_entity_data"

I've included the datapack for testing

Linked issues

Attachments

Comments 3

Please update the description to include steps to reproduce this issue, as well as expected VS observed results.

Please also attach any needed datapacks, resourcepacks, screenshots, videos or worlds needed to help reproduce this issue.

Can confirm in 1.21 Pre-Release 4:

[media]

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

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryThe official Minecraft feedback site

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

zer0p1us

(Unassigned)

Community Consensus

Advancements

Advancements, components

1.20.6, 1.21 Pre-Release 2, 1.21 Pre-Release 4, 1.21, 1.21 Release Candidate 1

Retrieved