Updated:
A gold, bold name by version
| Version | Command |
|---|---|
| Java 1.21.5+ | /give @p minecraft:diamond_sword[custom_name={text:"Legendary Sword",color:"gold",bold:true,italic:false}] |
| Java 1.20.5–1.21.4 | /give @p minecraft:diamond_sword[custom_name='{"text":"Legendary Sword","color":"gold","bold":true,"italic":false}'] |
| Java 1.13–1.20.4 | /give @p minecraft:diamond_sword{display:{Name:'{"text":"Legendary Sword","color":"gold","bold":true,"italic":false}'}} |
Up to 1.21.4 the name is a JSON string wrapped in single quotes. From 1.21.5 you write {text:…} directly. The old form on a new version gives an error or shows the raw {"text":…} as the name.
Color names
| Name | Name | Name | Name |
|---|---|---|---|
black | dark_blue | dark_green | dark_aqua |
dark_red | dark_purple | gold | gray |
dark_gray | blue | green | aqua |
red | light_purple | yellow | white |
Since Java 1.16 you can also use any hex color, such as color:"#FF8800". There is no orange or purple.
Remove the italics
custom_name is shown in italics like an anvil rename unless you add italic:false. On 1.20.5+ you can use item_name instead, which is treated as the item's own name: never italic, and replaced if someone renames it on an anvil.
Several colors in one name (1.21.5+)
/give @p minecraft:diamond_sword[custom_name=[{text:"",italic:false},{text:"Legendary ",color:"gold"},{text:"Sword",color:"red",bold:true}]]
A list of parts lets each part have its own style. The first part's settings carry over to the rest, so an empty first part with italic:false removes italics for the whole name.
Colored lore (1.21.5+)
/give @p minecraft:diamond_sword[lore=[{text:"Once wielded by an ancient king",color:"gray",italic:false},{text:"High attack damage",color:"green",italic:false}]]
Each list entry is one line. Lore is purple italic by default. On 1.20.5–1.21.4 wrap each line as a string: '{"text":"…"}'.
Common problems
- Braces or quotes in the name: the format does not match your version.
- No color: check the color name spelling.
- Bedrock: /give cannot set names; use an anvil.
- Detecting the item later: add
custom_dataand test that instead of the name.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.