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.
There is no way to remove items if they are moved with the cursor, as far as I am aware, due to the fact that it doesn't have a slot id.
However clearing all other slots of a specific item and killing all dropped items is possible, using /replaceitem
. This would require 36 command blocks to clear items from every slot in the inventory apart from armor, 37 if you include offhand.
Inventory
/replaceitem entity @a slot.inventory.# minecraft:air
Replace #
with a number from 0 to 26, with 0 being top-left slot and 26 being bottom right slot of the inventory. This does not include the hotbar
Hotbar
/replaceitem entity @a slot.hotbar.# minecraft:air
Replace #
with a number from 0 to 8, 0 being far left hotbar slot, 8 being far right. This does not include offhand
Offhand
/replaceitem entity @a slot.weapon.offhand minecraft:air
To clear the entire inventory, use /clear <player>
I know its a late answer, but this will work. It may cause a bit of lag. You will not be able to use any other items, unless you find a way of specifying what item to replace. I have tested /clear
for its maxCount
parameter, but it specifies the maximum amount to be cleared, not the maximum items left.
Good luck!
Best Answer
Try doing this: /clear (username) spawn_egg (item data) (amount)
For example, "/clear player123 spawn_egg 52 43" would clear 43 spider eggs from player123's inventory.
However, it is different if you have Essentials/EssentialsX installed.
I'm not entirely sure how to clear specific items, but I'm pretty sure "/clear player123 spawn_egg:52 43" would clear 43 spider eggs from player123.
Have a great day, I hope this helped! :)