EN

Anvil Color Codes

Anvil color codes let you give items colored and bold names. Bedrock lets you type § codes straight into the anvil; Java needs a command, which this tool writes for you.

Name

Color

Style

Result

My Sword

Bedrock anvil text

Java command

How to use it

  1. Type the name and pick a color and style.
  2. Copy the Bedrock text into the anvil name box, or run the Java command.
  3. The preview shows how the name looks in game.

Good to know

  • Rename during your last book step: it adds just 1 level there, while a separate rename costs 1 level plus the whole penalty.
  • Names are limited to 50 characters in Java and 30 in Bedrock.
  • Italic is on by default for renamed items in Java; the command turns it off.

Related: Anvil guide, Command generator, and the enchantment calculator for the cheapest anvil order.

Color codes

CodeColorName in commands
§0Blackblack
§1Dark Bluedark_blue
§2Dark Greendark_green
§3Dark Aquadark_aqua
§4Dark Reddark_red
§5Dark Purpledark_purple
§6Goldgold
§7Graygray
§8Dark Graydark_gray
§9Blueblue
§aGreengreen
§bAquaaqua
§cRedred
§dLight Purplelight_purple
§eYellowyellow
§fWhitewhite

Formatting codes: §l bold, §o italic, §n underline, §m strikethrough, §k obfuscated, §r reset.

Java vs Bedrock

In Java Edition the anvil ignores § codes, so colored names need a command (or a data pack). In Bedrock you can type the § symbol into the anvil's name box directly. Either way, renaming in an anvil costs 1 level plus the item's prior work penalty.

The Java command, part by part

The Java output looks like /give @p netherite_sword[custom_name={text:"My Sword",color:"gold",italic:false}]. Here is what each part does:

  • custom_name is the item component that holds the name. It takes a text component in curly brackets.
  • text is the name itself, in double quotes. Put a backslash before any quote inside the name.
  • color takes one of the 16 names in the table above, or a hex code such as "#FF8800" for any color.
  • italic:false turns off the slanted style Java gives every custom name by default.
  • bold, underlined, strikethrough and obfuscated each take true or false.
  • Add font:"minecraft:alt" to write the name in the glyphs from the enchanting table translator.

Several colors in one name

For a two-tone name, use a list of parts instead of one part. For example, custom_name=[{text:"Fire",color:"red",italic:false},{text:"brand",color:"gold",italic:false}] gives a red "Fire" and a gold "brand". Keep italic:false on every part to be safe.

Older Java versions

From 1.20.5 to 1.21.4 the component took a JSON string in single quotes: custom_name='{"text":"My Sword","color":"gold"}'. Before 1.20.5 names lived in {display:{Name:'{"text":"My Sword"}'}}. The tool writes the current format for Java 26.3.

Bedrock codes and their limits

On Bedrock, type the § sign and a code before your text, for example §6§lExcalibur for a bold gold name. Put the color code first and the style codes after it, as the tool does. A §r resets everything after it.

Bedrock also has extra colors, such as §g for minecoin gold. However, Bedrock uses §m and §n as color codes, not as strikethrough and underline. So the tool leaves those two styles out of the Bedrock text; bold and italic work fine.

What a rename costs

A rename costs 1 level plus the item's prior work penalty. On a fresh item that is just 1 level. On a sword with 4 anvil uses it is 1 + 15 = 16 levels. In Java the sword still has 4 uses afterwards, because a rename on its own does not raise the penalty.

So rename in the same step as your last book. That adds only 1 level and no extra use. The prior work penalty calculator has a rename box to check the total.

Java also caps a rename-only step at 39 levels. As a result, you can always rename an item, even one that shows Too Expensive for books, as long as you have the levels.

Tips for good names

  • Keep names short. Java stops at 50 characters, and short names read better when they pop up over the hotbar.
  • Dark colors like dark blue and black are hard to read on the dark tooltip, so pick a bright color for the main word.
  • Aqua and light purple match the game's own rare and epic item colors, so they look natural on enchanted gear.
  • Test the command on a cheap item first. Then swap in your real item id when the name looks right.

Names that do something

Most names are just for show, but a few change a mob when you use a renamed name tag on it in Java:

  • Dinnerbone or Grumm turns any mob upside down.
  • jeb_ on a sheep makes its wool cycle through every color.
  • Toast on a rabbit gives it its own special skin.
  • Johnny on a vindicator makes it attack almost every mob near it.
  • Any named mob stops despawning, so name the villagers in your trading hall.

Questions

How much does it cost to rename an item?

One level plus the item's prior work penalty. Doing it during your last book step is cheaper: there it adds just 1 level.

Can you rename an item that says Too Expensive?

Yes, in Java a rename-only step is capped at 39 levels. You can always do it if you have enough levels.

How do you make a multi-colored item name?

In Java, use a list of text parts with a color on each, as shown above. On Bedrock, put a § code before each letter or word.

How do you remove a custom name from an item?

Put the item in an anvil, clear the name box and take the result. It costs the same as a rename.

Can you use color codes in an anvil in Java?

No, the Java anvil strips them. Use /give with custom_name, as this tool makes.

How do you type § on Bedrock?

Copy it from this page, or on some keyboards use Alt+21 (Windows).