#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)

gentle geyser
#

what condition do I need to use to check if a player died with some item in the inventory

frank sluiceBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

short horizon
#

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

gentle geyser
short horizon
#

For many/most causes, yes. That can also be done with conditions in the advancement, often something like a damage_source predicate iirc

gentle geyser
#

What to choose from this?

#

And the question is, is it possible to somehow establish a certain number of these items?

short horizon
gentle geyser
gentle geyser
short horizon
short horizon
gentle geyser
short horizon
#

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)

gentle geyser
short horizon
gentle geyser
#
{
  "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

gentle geyser
#

Sorry, I didn't see. Have you left?

short horizon
#

You checked the location of the killing entity, not of the player

gentle geyser
#
{
  "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
              }
            }
          }
        }
      }
    }
  }
}
short horizon
#

Looks good

gentle geyser
short horizon
#

Can you grant it in chat?

gentle geyser
#

yes

short horizon
#

Then this may be one of the causes of death that doesn't trigger this advancement