Minecraft – Why can’t I paste § into a Minecraft command

minecraft-commandsminecraft-java-edition

According to https://minecraft.gamepedia.com/Formatting_codes, using §1 in an item's name should make the text colored dark blue.

However, when I copy-paste a command like this one into chat:

/give @p diamond_sword{display:{Name:"{\"text\":\"§1Sword\"}"}}

it comes out like this:

/give @p diamond_sword{display:{Name:"{\"text\":\"1Sword\"}"}}

See the problem? I can't copy § into chat!

Which means the name ends up being "1Sword" rather than "Sword" colored dark blue.

Why can't I copy § into chat? What can I do to fix it?

Note: I've tested this issue on Minecraft versions 1.14.3 and 1.12.2. It worked the same on both. Feel free to leave a comment if you need more details.

Best Answer

You can actually set a color with the color-tag inside of the Name-tag by using a command like this:

/give @p diamond_sword{display:{Name:"{\"text\":\"Sword\",\"color\":\"dark_blue\"}"}}