#simple criteria problem
1 messages · Page 1 of 1 (latest)
What do you mean criteria?
So you want an advancement for successfully equipping a certain armor item?
yes
but i dont know which trigger i should use to make it work
tick and conditions checking in equipment and Whichever armor piece you want to detect
it should give u instantly once u wear the armor oiece
piece*
you can use inventory_changed instead of tick and it will be way more efficient
i'm back
it took a while
"criteria": {
"gold": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"nbt": "{Tags:[\"goblin\"]}"
},
"slots": {
"occupied": {
"min": 100,
"max": 103
}
},
"items": [
{
"items": [
"minecraft:golden_helmet",
"minecraft:golden_chestplate",
"minecraft:golden_leggings",
"minecraft:golden_boots"
]
}
]
}
}
},
"rewards": {
"function": "afterlight:goblin/ggold"
}
}```
like this?
No
Occupied tracks the number/amount of slots that are used
Are you using the generator Misode made?
I would simply check for the armor in player -> equipment
Do you want to detect any piece or a full set of golden armor?
You will only detect the latter if you have only a single criterium
only a piece
what if i specified every slot with a different criteria for each one?
That, and you need to add the requirements section with a sublist containing all 4 criteria, so any of them counts as completing the entire advancement, regardless of which one it is.
the wiki explains as much, but in short.
Criteria: A,B,C,D,E
A or B or C or D or E = [["A","B","C","D","E"]]
(A or B or C) and (D or E) =
[["A","B","C"]["D","E"]]
The default is to require all of them
"criteria": {
"cabeça": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"nbt": "{Tags:[\"goblin\"]}"
},
"slots": {
"occupied": 103
},
"items": [
{
"items": "minecraft:golden_helmet"
}
]
}
},
"peito": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"nbt": "{Tags:[\"goblin\"]}"
},
"slots": {
"occupied": 102
},
"items": [
{
"items": "minecraft:golden_chestplate"
}
]
}
},
"pernas": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"nbt": "{Tags:[\"goblin\"]}"
},
"slots": {
"occupied": 101
},
"items": [
{
"items": "minecraft:golden_leggings"
}
]
}
},
"pé": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"nbt": "{Tags:[\"goblin\"]}"
},
"slots": {
"occupied": 100
},
"items": [
{
"items": "minecraft:golden_boots"
}
]
}
}
},
"requirements": [
[
"cabeça",
"peito",
"pernas",
"pé"
]
],
"rewards": {
"function": "afterlight:goblin/ggold"
}
}```
didn't worked
actually i have a better idea
As Quimoth said, occupied tracks the number of slots that have items in them. Since player inventory is only 41 slots, this condition will always fail
{
"criteria": {
"eat": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": {
"equipment": {
"head": {
"items": "minecraft:golden_helmet"
}
}
}
}
}
},
"rewards": {
"function": "a"
}
}```
Better would be to use a predicate for the player :
{
"criteria": {
"eat": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": [
{
"condition": "minecraft:reference",
"name": "a"
}
]
}
}
},
"rewards": {
"function": "a"
}
}
[
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "tags:tags"
}
},
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"equipment": {
"head": {
"items": "item"
}
}
}
}
]
}
]