Clear a custom item from Inventory

Clear a custom item from Inventory - Top view of metal pendulum device placed on white table in psychiatrical clinic

I've looked at a few other questions on here about this, but I still can't get this to work. I've already looked at this: Clear item with custom name?

I'm trying to clear a custom item (just one) from a player's inventory through a command block.

Here's my command:

/clear @p gold_ingot 0 1 {display:{Name:"Stamped Gold Bar",Lore:["One Gold Bar","Stamped on site at Acacia Mint"],,ench:[{id: 34, lvl:1}]}}

Here's my error message:

[00:37:53] Removed 0 of gold_ingot from Jowaaay.

Even if I just do /clear @p gold_ingot, it will not remove my custom gold ingot, and will still give the same error message. I tried putting regular gold ingots into my inventory just to test that I had the correct syntax, and regular items do seem to cooperate with the /clear command.

I followed the advice given by the user who solved the above question, but I still can't get this to work. Wondering if it has to do with the enchantment on the gold ingot?

I'm running a Bukkit server with a 1.8 Minecraft. I do have Essentials installed, but I don't see how that would affect this.



Best Answer

First you need to close the display:{} tag then remove the extra comma. So it should look like this:

/clear @p gold_ingot 1 0 {display:{Name:"Stamped Gold Bar",Lore:["One Gold Bar","Stamped on site at Acacia Mint"]},ench:[{id:34,lvl:1}]}}

This will most likely work, I'm not sure though.




Pictures about "Clear a custom item from Inventory"

Clear a custom item from Inventory - Blackboard surrounded with cones and pebbles
Clear a custom item from Inventory - Interior of modern kitchen in office
Clear a custom item from Inventory - Mock up business cards on board with cotton



What command do you use to clear your inventory in Minecraft?

You can use the command /clear [targets] [item] [maxCount] , where: targets is optional. It is the name of the player (or a target selector) whose inventory you wish to clear. If no player is specified, it will default to the player running the command.

How do you Unname an item in Minecraft?

Look at the text field. All you need to do is enter one or more spaces into the box. And voila, the custom name is gone!

How do you clear your inventory in bedrock PC?

How to clear Hotbar on PC Minecraft? In the survival inventory tab of the creative inventory, \u21e7 + Shift + clicking the X clears the whole inventory. In any other tab, \u21e7 + Shift + clicking an item puts a stack onto the hotbar.



Using Commands in Minecraft: /clear and Custom Item Names! | 1.11.2




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Skylar Kang, Brett Sayles, Max Vakhtbovych, Monstera