I'm trying to use predicates inside of advancement triggers.
According to the wiki I should be abled to use the player
tag, but I couldn't figure out, how the syntax works exactly.
player: The player that would get the advancement. May also be a list of predicates that must pass in order for the trigger to activate.
This version
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": [
"oneheart:holds_flower",
"oneheart:armor/any"
]
}
gives this error
Parsing error loading custom advancement
oneheart:armor/flower
: Object “oneheart:holds_flower
” can't be deserialized
I also found this reddit post, but the syntax given in the answers
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": [
{
"condition": "reference",
"oneheart:holds_flower": true
},
{
"condition": "reference",
"oneheart:armor/any": true
}
]
}
gives me an error when reloading as well
Parsing error loading custom advancement
oneheart:armor/flower
: Missingname
, expected to find a string
Since the JSON for the player property check is also named predicate
, I also just tried this:
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"reference": {
"oneheart:holds_flower": true,
"oneheart:armor/any": true
}
}
}
]
}
This doesn't result in an error when reloading, but the code also doesn't work. Any inventory change will grant the advancement, without checking the predicates.
What is the correct way to do this?
Note: I've double checked both predicates and also the combination of both. They aren't the problem.