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"}]67 characters
- 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
Get elytra-boosting rockets with maximum flight duration
/give @p firework_rocket[fireworks={flight_duration:3}] 64