Updated:
Java 1.21.5 and later
/give @p minecraft:netherite_sword[enchantments={sharpness:255,looting:10,fire_aspect:2,sweeping_edge:3,mending:1,unbreaking:3},unbreakable={},custom_name="God Sword"] 1
enchantments: enchantment IDs and levels, up to 255.unbreakable={}: the sword never loses durability.custom_name: the item name.
Java 1.20.5 – 1.21.4
/give @p minecraft:netherite_sword[enchantments={levels:{sharpness:255,looting:10}},unbreakable={}] 1
These versions need the extra levels:{…} wrapper. The custom name was written as a JSON string, so the Give generator is the easiest way to get it right for your version.
Java 1.20.4 and earlier
/give @p minecraft:netherite_sword{Enchantments:[{id:"minecraft:sharpness",lvl:255s}],Unbreakable:1b} 1
This NBT form is why commands from old videos turn red on current versions.
Sword enchantments
| Enchantment | ID | Normal max |
|---|---|---|
| Sharpness | sharpness | V |
| Looting | looting | III |
| Fire Aspect | fire_aspect | II |
| Knockback | knockback | II |
| Sweeping Edge (Java) | sweeping_edge | III |
| Unbreaking | unbreaking | III |
| Mending | mending | I |
Sharpness, Smite and Bane of Arthropods normally cannot be combined, but /give ignores that rule.
Raise the damage itself (Java 1.21.5+)
Instead of enchantments, you can set the sword's attack damage and speed directly.
/give @p minecraft:diamond_sword[attribute_modifiers=[{type:"attack_damage",amount:19,operation:"add_value",id:"mypack:damage",slot:"mainhand"},{type:"attack_speed",amount:-2.4,operation:"add_value",id:"mypack:speed",slot:"mainhand"}]] 1
- A player's base attack is 1, so an amount of 19 deals 20 damage (ten hearts).
- Writing attribute_modifiers replaces the sword's built-in damage and speed. Without the attack_speed line the sword has no cooldown, so -2.4 keeps the normal sword speed.
- On 1.20.5–1.21.4 wrap the list as
attribute_modifiers={modifiers:[...]}. On 1.21.1 and earlier the type isgeneric.attack_damage.
Bedrock Edition
/give @p netherite_sword
/enchant @p sharpness 5
/enchant @p looting 3
/enchant @p unbreaking 3
Hold the sword while running /enchant. Bedrock commands cannot go above the normal maximum level.
Common problems
- The command is red: the format does not match your version; see the sections above.
- Too long for chat: chat has a length limit; paste long commands into a command block.
- Mobs do not die in one hit: bosses and armored mobs take less damage; very high Sharpness still kills almost everything.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.