#Help with little datapack
1 messages · Page 1 of 1 (latest)
You can do this with an advancement, entity_killed_player criteria, which then checks if the source entity is a player and runs a reward function to give the kit and revoke the advancement
{ "criteria": { "entity_killed_player": { "trigger": "minecraft:entity_killed_player", "conditions": { "entity": { "type": "minecraft:player" } } } } }
like this
Looks right
i tested it and it give the stuff but once i click respawn it disappear
Ah that makes sense, you'll need to have the advancement also check if the player is alive as a separate criteria. Each criteria gets tracked separately, so if a player is killed by another player, that crtera will grant, but the whole advancement won't grant until the second criteria is met. Then you can still revoke the entire advancement
Or you do /gamerule keepInventory true
My brain says that works too, but i have no idea
didnt work so i did it with nbt to see if the player health is above 0 i give the kit
oh