2

I would like to clear ANY item with a lore of "This is an item of death.." I can achieve this with a diamond chest plate by doing clear @a minecraft:diamond_chestplate -1 -1 {display:{Lore:[This is an item of death..]}}

But I want to be able to do this with one command block and no scoreboards. In other words I need to know how to specify any item.

5
  • 2
    As far as I am aware, you cannot do this with one command.
    – SirBenet
    Commented Nov 24, 2015 at 17:09
  • As far as I know, the lore for clear can be done from command blocks. There is no actual way to specify an item. You just need to give it something unique (like an enchantment, name, lore, etc.).
    – John K
    Commented Nov 24, 2015 at 18:03
  • @JohnSmith What do you mean by "no actual way to specify an item"? There are ids... to specify the type of item (e.g. diamond_chestplate). Of course, the exact item object (in the game code) cannot be accessed through a cmd-block.
    – Marco
    Commented Nov 26, 2015 at 12:34
  • @1Darco1 yes with ids. But i mean like this one unique item. That cannbe distinguished from same id items through effects, name, lore
    – John K
    Commented Nov 26, 2015 at 13:20
  • 2
    Possible duplicate of How can I specify only NBT in the /clear command, not an item? or How to remove specific NBT items from player inventory without data packs (closing older question as duplicate of newer question because this question has an outdated answer)
    – pppery
    Commented Feb 10, 2022 at 2:53

1 Answer 1

1

This is technically impossible to be done with a single command block. If you want to enter metadata (like {display:{Lore:[This is an item of death..]}}) you have to enter the item type in the other argument in order to work, that means you have to specify the item type.

2
  • 1
    Could you suggest a way to do this with more then one command block? Commented Nov 28, 2015 at 14:08
  • You would do "clear @a <item_type> <data> 64 {display:{Lore:[This is an item of death..]}}" replacing <item_type> with each of the items that you would clear, and <data> with the durability of that item to clear (used in colored wool and others). Commented Nov 28, 2015 at 14:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.