Minecraft – How to delete all items but one in a players inventory

minecraft-commandsminecraft-java-edition

I'm trying to make a map where a player has a diamond chestplate named "Heros Chestplate" and I was wondering if there is a command out there that deletes all items in a player's inventory but that item? I'm currently in 1.8.8 and
I'm using the command /clear @a !minecraft:diamond_chestplate 1 0 {display:{Name:"Hero's Chestplate"},ench:[{id:34,lvl:150}]}

Best Answer

The only thing you could do is clear the player's inventory and give them a new hero chestplate

/clear @a
/give @a minecraft:diamond_chestplate 1 0 {display:{Name:"Hero's Chestplate"},ench:[{id:34,lvl:150}]}