Skip to content
[/craft]

Give Custom Named Sword

Create a diamond sword with a custom display name

✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026

Gives a diamond sword named Excalibur in gold text using the 1.21.5+ SNBT custom_name component. Edit the text and color values to name any item. Note that the SNBT text form replaced the old JSON-string syntax in 1.21.5.

/give @p diamond_sword[custom_name={text:"Excalibur",color:"gold"}]
67 characters

How to use

  1. Open chat (T on Java).
  2. Replace Excalibur with your desired name and pick a color.
  3. Paste and press Enter.
  4. The named sword appears with the colored label in your inventory.

Related commands

Get a pair of elytra wings

/give @p elytra

Get the dragon egg without having to chase it into a portal

/give @p dragon_egg

Get elytra-boosting rockets with maximum flight duration

/give @p firework_rocket[fireworks={flight_duration:3}] 64

Get a stack of sponges for draining water

/give @p sponge 64

Get invisible unbreakable barrier blocks

/give @p barrier 64

Get invisible light source blocks

/give @p light