Give Custom Named Sword
Create a diamond sword with a custom display name
✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026Gives 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"}]- Java: yes
- Bedrock: no
- Command block: yes
- Needs cheats / OP: yes
How to use
- Open chat (T on Java).
- Replace Excalibur with your desired name and pick a color.
- Paste and press Enter.
- The named sword appears with the colored label in your inventory.
Related commands
Give Elytra
Get a pair of elytra wings
Give Dragon Egg
Get the dragon egg without having to chase it into a portal
Give 64 Firework Rockets (Flight 3)
Get elytra-boosting rockets with maximum flight duration
Give 64 Sponges
Get a stack of sponges for draining water
Give 64 Barrier Blocks
Get invisible unbreakable barrier blocks
Give Light Blocks
Get invisible light source blocks