Add custom name on items created through commands

Add custom name on items created through commands - Assorted yummy sweets and bakery products places on counter of confectionery shop in daytime

I'm trying to summon a villager who is buying 4 iron and selling an iron pick that can destroy iron and gold blocks. How can I add onto this command to give this pickaxe a custom nametag

/summon Villager ~-1 ~ ~3 {CustomName:Leroy,CustomNameVisible:0,NoAI:1,Offers:{Recipes:[{maxUses:10,buy:{id:iron_ingot,Count:4,Damage:#},buyB:{id:#,Count:#,Damage:#},sell:{id:iron_pickaxe,Count:1,Damage:#,tag:{CanDestroy:["minecraft:iron_block","minecraft:gold_block"]}}}]}}


Best Answer

This should work

/summon Villager ~-1 ~ ~3 {CustomName:Leroy,CustomNameVisible:0,NoAI:1,Offers:{Recipes:[{maxUses:10,buy:{id:iron_ingot,Count:4,Damage:#},buyB:{id:#,Count:#,Damage:#},sell:{id:iron_pickaxe,Count:1,Damage:#,tag:{CanDestroy:["minecraft:iron_block","minecraft:gold_block"]Display:{Name:"Weak iron pickaxe"}}}}]}}



Pictures about "Add custom name on items created through commands"

Add custom name on items created through commands - Unrecognizable male master with small jar adding white paint into blue pigment while working at table with stencil printing in studio on blurred background
Add custom name on items created through commands - Customer paying for taxi service in dollars
Add custom name on items created through commands - View through open window of unrecognizable driver accepting payment in cash from crop customer sitting on back seat



How do you give items custom names using commands?

How to Enter the Command
  • Open the Chat Window. The easiest way to run a command in Minecraft is within the chat window.
  • Type the Command. In this example, we are going to summon a cow named Daisy in Minecraft Java Edition (PC/Mac) 1.18 with the following command: /summon cow ~ ~ ~ {CustomName:"\\"Daisy\\""}




  • How to get Items with Custom Names




    More answers regarding add custom name on items created through commands

    Answer 2

    There were a couple things wrong with the command: the strings needed quotes, The unneeded attributes were removed, some things needed the minecraft: namespace, and the display tag was changed to show the custom name. The Damage attribute can be changed to make the pickaxe have more or less duribility

    /summon Villager ~-1 ~ ~3 {CustomName:"Leroy",CustomNameVisible:0,NoAI:1,Offers:{Recipes:[{maxUses:10,buy:{id:"minecraft:iron_ingot",Count:4},sell:{id:"minecraft:iron_pickaxe",Count:1,Damage:200,tag:{CanDestroy:["minecraft:iron_block","minecraft:gold_block"],display:{Name:"Weak iron pickaxe"}}}}]}}
    

    I have run this command in minecraft 1.9, and it seems to work, but if there are any problems please leave a comment.

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

    Images: Maria Orlova, Anna Shvets, Tim Samuel, Tim Samuel