0

Using 1.9 pre-4 and I'm trying to remove any armor, or in the future any item in general, with a specific name for a mini-game.

Is there a way to get say leather boots (any damage level) with the name "test" out of someone's inventory? Is there a way to remove any item at all with the name "test" from someone's inventory that's not too intensive?

I've tried using this to remove the test boots when the tag's removed (and confirmed that the tag has been removed):

/clear @a[tag=!testtag] minecraft:leather_boots {Inventory:[{tag:{display:{Name:"test"}}}]}

/clear @a[tag=!testtag] minecraft:leather_boots 1 {Inventory:[{tag:{display:{Name:"test"}}}]}

/clear @a[tag=!testtag] minecraft:leather_boots 1 0 {Inventory:[{tag:{display:{Name:"test"}}}]}

/clear @a[tag=!testtag] minecraft:leather_boots 1 * {Inventory:[{tag:{display:{Name:"test"}}}]}

1 Answer 1

2

The NBT data for /clear (and /give and /replaceitem) is already starting within the tag compound of the item format, which will be compared to each of the player's slots automatically. Setting the Damage value to -1 allows finding any Damage value. The Damage value is also specified before the maximum number of items to remove, which you can also set to -1 to clear all items.

/clear <player> [id] [Damage] [maximum amount] {tag}
/clear @a[tag=!testtag] minecraft:leather_boots -1 -1 {display:{Name:"test"}}

You must log in to answer this question.

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