With the new item component system, a functionality has been removed/replaced. We can't have an advancement that would trigger if the player is wearing an equipment with a specific enchantment, as now the comparison is of type "is exactly" instead of "contains".
Steps to repro:
have a datapack adding an advancement such as the one attached
go in the nether with a chestplate enchanted with the binding curse and any other enchant
Expected behavior (as before):
The advancement is triggered.
Observed behavior:
The advancement is not triggered. It can be triggered only if the chestplate has only the binding curse enchantment.
Although I understand this behavior could be useful, I believe the previous one is more interesting. At least being able to choose the way the predicate is being tested would be nice.
Attachments
Comments 3
Although I understand this behavior could be useful, I believe the previous one is more interesting. At least being able to choose the way the predicate is being tested would be nice.
There already is a way to do that. You need to make the following change to your advancement:
"components": {
"minecraft:enchantments": {
"levels": {
"minecraft:binding_curse": 1
}
}
}
This needs to be changed to the following:
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:binding_curse",
"levels": 1
}
]
}
Have you tried it with the
minecraft:enchantments
item sub-predicate instead? The wiki has the current format.