0

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.

2 Answers 2

2

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}]}
3
  • Thanks for you answer, I didn't think about that and i love the idea, but the player will not be able to enchant the armor with the table ?
    – Okano
    Commented Jun 17, 2018 at 11:02
  • That's correct. I don't really know a good workaround for that. I'll post an alternative answer. Commented Jun 17, 2018 at 13:40
  • 1
    "Curse of vanishing book and anvil, presumably"
    – pppery
    Commented Jul 29, 2019 at 20:19
1

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.

3
  • Thanks again for the answer as I said in my question the problem is if the player wear an iron helmet with enchant and have others iron helmet in his inventory, on death it is not possible to distinguish them... and all will be deleted. the problem of other armor on the ground can be solved with the Age data
    – Okano
    Commented Jun 17, 2018 at 15:39
  • Well, then it's impossible. When the player is dead, his items are no longer in his inventory, so you can't figure out the slot. Commented Jun 17, 2018 at 16:42
  • 1
    This is what I think too, without a plugin I don't think it's possible, but since I'm not the best for command block I preferred to ask, thank a lot for your time
    – Okano
    Commented Jun 17, 2018 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .