I'm searching an efficient way with command block to remove armor on player death but throwing the rest normally.

With keepinventory on false, I'm trying to do a /replaceitem air on death, but the armor is thrown first and it's not working. I also tried to put a tag on item armor and kill it, but there is a problem if a player have two of the same type of armor in his inventory.

I have Spigot but I didn't find an updated plugin able to do that.


Solution 1:

Give them the curse of vanishing, then they'll disappear on death.

A few options to achieve that:

  • Curse of vanishing book and anvil
  • /give @p diamond_helmet 1 0 {ench:[{id:71,lvl:1}]}
  • /replaceitem entity @s slot.armor.head diamond_helmet 1 0 {ench:[{id:71,lvl:1}]}

Solution 2:

You can delete armour items on the ground:

/scoreboard players tag @e[type=item] add deleteMe {Item:{id:"minecraft:diamond_helmet"}}
/kill @e[tag=deleteMe]

But this will delete every dropped armour piece, so you should make it trigger based on death, for example with a deathCount statistic scoreboard.