#what condition do I need to use to check if a player died with some item in the inventory?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1740261221:t>, feel free to use the Summon Helpers button to ping our helper team.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
The entity_killed_player advancement criteria will trigger under most circumstances the player dies, including many where no other entity is responsible. In this, you can do an entity_properties predicate as the condition for the player, and check their container.* slot for the desired item
Is it possible to somehow set a certain death for a player, i.e. give the player an achievement if they die, for example, from the void, but not give it to them if they die in lava?
For many/most causes, yes. That can also be done with conditions in the advancement, often something like a damage_source predicate iirc
What to choose from this?
And the question is, is it possible to somehow establish a certain number of these items?
That's somewhere completely different, those are item components
I'll need you to elaborate
Okay, where do I set the predicate of what the player died from?
How do I set a certain number of items that must be in the inventory, including the hallway, upon death?
The killing blow
In theory you can use the Count option there, but it may only check for that quantity in a single stack, not combined. Unsure
How do I check if a player died from a Void?
The void isn't an entity, you don't want to check for a source entity
You want to check the Tags, which here means the damage tags that will trigger the criteria
And then either find the damage tag that void damage is in, or possibly make one if there isn't (though I imagine there probably is)
Okay then, here's the question: how do I check if a player died below -64 altitude?
How about you take a close look at this image and see if anything there might be able to check for that
{
"display": {
"icon": {
"id": "minecraft:diamond"
},
"title": {
"text": "Податок на життя",
"color": "aqua"
},
"description": {
"text": "Заповнити весь нвентарь стаками діамінтів і впати в воїд",
"color": "dark_purple"
},
"frame": "challenge"
},
"parent": "main:legendary/root",
"criteria": {
"t": {
"trigger": "minecraft:entity_killed_player",
"conditions": {
"killing_blow": {
"direct_entity": {
"location": {
"position": {
"y": {
"max": -65
}
}
}
}
}
}
}
}
}
Well I did it like this but it doesn't work
.
Sorry, I didn't see. Have you left?
You checked the location of the killing entity, not of the player
{
"display": {
"icon": {
"id": "minecraft:diamond"
},
"title": {
"text": "Податок на життя",
"color": "aqua"
},
"description": {
"text": "Заповнити весь нвентарь стаками діамінтів і впати в воїд",
"color": "dark_purple"
},
"frame": "challenge"
},
"parent": "main:legendary/root",
"criteria": {
"t": {
"trigger": "minecraft:entity_killed_player",
"conditions": {
"player": {
"location": {
"position": {
"y": {
"max": -65
}
}
}
}
}
}
}
}
Looks good
still doesn't work
Can you grant it in chat?
yes
Then this may be one of the causes of death that doesn't trigger this advancement