Minecraft scoreboard command to kill an item with a certain name

minecraft-commandsminecraft-java-edition

I have commands set up to kill an item whenever they touch the ground. In this case it is iron boots but I want to know how I can kill iron boots with a certain name. I think I have to add the custom name into the following command:

/scoreboard players set @e[type=Item] IronB 1 {Item:{id:minecraft:iron_boots}}

But I don't know how to add the custom name. I couldn't find a solution anywhere, and tried to figure it out myself but failed. Sorry if my question isn't clear.

Best Answer

The command you want should be:

/scoreboard players set @e[type=Item] IronB 1 {Item:{id:minecraft:iron_boots,tag:{display:{Name:"Named boots"}}}}

Where you replace Named boots with the item name you have given them.

Then /kill @e[score_IronB_min=1].

Related Topic