-
Bug
-
Resolution: Invalid
-
None
-
1.20.5 Pre-Release 1
-
None
-
Unconfirmed
-
(Unassigned)
I was working on an advancement trigger which is meant to trigger upon obtaining any item that has been trimmed with the amethyst material.
"amethyst": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "components": { "minecraft:trim": { "material": "minecraft:amethyst" } } } ] } }
However, this error message appears in the output log
Parsing error loading custom advancement minecraft:test_without_pattern: No key pattern in MapLike[{"material":"minecraft:amethyst"}] missed input: {"minecraft:trim":{"material":"minecraft:amethyst"}} missed input: {"amethyst":{"trigger":"minecraft:inventory_changed","conditions":{"items":[{"components":{"minecraft:trim":{"material":"minecraft:amethyst"}}}]}}}
I have also noticed similar behaviour when working with the charged_projectiles component, and this other bug report highlights it may also be affecting the lodestone_tracker pos.
This leads me to believe that with components in advancements and predicates, all components have to be specified.
This is not intended behaviour. I refer to the official article on snapshot 24w09a, which states with regard to predicate formats:
- All specified components must be present an exactly equal on the target item, but additional components may be ignored
I have uploaded a datapack which can be used to test this out. Steps to reproduce:
1) Install the datapack on a creative world
2) Use a smithing table to apply a trim with pattern tide and material amethyst to any armor item, or use this command:
/give @s diamond_helmet[minecraft:trim={material:amethyst,pattern:tide}]
3) The advancement "Test with pattern" will be obtained, but there is a second advancement in the datapack, "Test without pattern" that does not check for the pattern and is meant to trigger upon obtaining an item with amethyst material but the pattern does not matter. This advancement will not appear at all and will cause the above error in the output log.