Sword

A sword is a melee weapon that is mainly used to deal damage to mobs and/or players. Swords are also useful for mining cobwebs.

Unit repair
A sword can be repaired in an anvil by adding units of the corresponding material, each restores 25% its maximum durability, rounded down.

Mobs
Some monsters can spawn with a sword, and have an 8.5% (9.5% with Looting I, 10.5% with Looting II and 11.5% with Looting III) chance of dropping them upon death by player: Zombies and husks can drop iron swords, zombie pigmen can drop golden swords, and wither skeletons can drop stone swords. The dropped sword is usually badly damaged and may be enchanted. Stone swords dropped by wither skeletons are always unenchanted.

A vex wields an iron sword that normally has a 0% chance of dropping, because their main hand's  is 0. However, this chance increases by 1 percentage point per level of Looting. It is never damaged and may be enchanted.

In Bedrock Edition, pillagers and vindicators that spawn from raids have a 4.1% chance (5.12% chance on hard) of dropping an iron sword, badly damaged although it can be enchanted with a random enchantment.

Trading
Apprentice-level weaponsmith villagers sell enchanted iron swords for 2 emeralds, and expert-level weaponsmiths sell enchanted diamond swords for 8 emeralds.

Novice-level weaponsmith villagers have a $2/3$ chance of selling an enchanted iron sword for 7-22 emeralds. Master-level weaponsmiths offer to sell an enchanted diamond sword for 11-27 emeralds.

The enchantments are the same as the ones obtained from an enchantment table at levels 5–19.

Natural generation

 * Notes

Attacking
Pressing while holding a sword inflicts damage on both mobs and other players. Upon damaging a mob or player, the sword's durability decreases by 1.

Attacking a boat or a minecart with a sword instantly destroys it, without decreasing the sword's durability.

Sweep attack
If the attack recharge meter is 84.8% or above, and the player is standing or moving no faster than walking speed, the sword performs a "sweep" attack that can hit nearby enemies. Enemies near the hit enemy are knocked back and damaged by from the slashing attack. The Sweeping Edge enchantment increases the damage dealt by 50% of the normal hit damage for level I, 67% for level II, and 75% for level III. The amount of knockback is 80% that of the knockback due to Knockback I (in other words, 2.8 blocks), and does not benefit from that enchantment. All enemies within 1 block horizontally and 0.25 blocks vertically of any part of the attacked mob and within up to 4 blocks of the player are knocked back. It is impossible to perform both a sweep attack and critical hit on the same attack. A sweep attack will only be performed when the player swings downward--hitting an entity above the player's head will not perform a sweep attack.

Java Edition
Swords have an attack speed of 1.6 and take 0.625 seconds to recover.

Bedrock Edition
$$, swords have no attack cooldown or sweep attack and do the following damage:

The most amount of damage that a diamond sword enchanted with Sharpness V can do is 10 $$ and 14.5 $$ (without critical hits).

Knockback
$$, the knockback inflicted by swords is a bit higher than other melee items, especially while sprinting.

Sword breaking times
A sword can also be used to destroy certain blocks more quickly than with fists. Using a sword to destroy any block that doesn't break instantly decreases its durability by 2.

If a sword is enchanted with Silk Touch, either using Creative or commands, it can collect cobwebs rather than getting the string drop. This is due to the sword being classified as the proper tool for cobwebs.

The following table shows the time it takes to break blocks on which swords have any effect. Colors indicate what gets dropped:
 * White: an original block.
 * Blue: block's normal drop (e.g. seeds, sapling, apple).
 * Red: nothing.

Swords can also be used for instant breaking of bamboo.

Safety around constructions
In Creative mode, swords are unable to break most blocks. However, they can "break" (put out) fire, which are considered blocks. Care must also be taken around minecarts, paintings, item frames and armor stands, which are also not safe with swords in Creative.

Enchantments
Swords can receive the following enchantments:

Fuel
Wooden swords can be used as a fuel in furnaces, smelting 1 item per sword.

Video
''Note: This video is outdated. Since Java Edition 1.9, swords can no longer block attacks. Instead, shields are used.''

History
"The sword has been a part of Minecraft since January 2010, when it was added alongside diamonds, sticks... oh, and the entire crafting system. Since then, the basic sword concept has pretty much stayed the same but the details have been tweaked repeatedly. Enchantments were added in version 1.0.0, drops from mobs in 1.2.1, and 1.9 – the combat update – changed things up all over again."

- Duncan Geere

{{History||1.16|snap=20w06a| Added netherite swords. {{History||Combat Tests|snap=1.14.3 - Combat Test|Increased attack speed for all swords to 3. {{History|||snap=Combat Test 2|Decreased the attack speed of all swords to 2.5.}} {{History|||snap=Combat Test 3|Changed attack speed from 2.5 back to 3.0.
 * Increased damage for all swords by {{Hp|1}}.
 * Increased attack reach to 3.5 blocks.}}
 * The attack key can again be held down to automatically attack when the attack meter is full.
 * Attacks now only happen when the sword is at 120% charge, slower than if attacks were timed.}}

{{History|pocket alpha}} {{History||0.2.0| Added stone swords.}} {{History||0.3.0| Added wooden swords.}} {{History||0.3.2|  Added iron, gold, and diamond swords.}} {{History||0.9.0|snap=build 1|Iron swords can now be found in stronghold altar chests and inside blacksmith chests.}} {{History||0.11.0|snap=build 11|Wooden, stone, golden and diamond swords are now available in the creative inventory.}} {{History|||snap=build 12|Wooden, stone, golden and diamond swords have now been removed from creative.}} {{History|||snap=build 13|All swords are available in creative mode again.}} {{History||0.12.1|snap=build 1|In creative mode, swords are no longer able to break blocks, and no sound plays when they're hit with one. {{History||0.15.0|snap=build 1|Iron swords are now sometimes dropped by husks that spawn holding an iron sword.}} {{History|pocket}} {{History||1.0.0|snap=alpha 0.17.0.1|Enchanted iron and diamond swords can now be found in end city chests.}} {{History||1.0.4|snap=alpha 1.0.4.0|Iron swords and enchanted diamond swords are now sold by weaponsmith villagers.}} {{History||1.1.0|snap=alpha 1.1.0.0|Iron and golden swords are now smeltable. {{History|bedrock}} {{History||1.10.0|snap=beta 1.10.0.3|    The textures of all swords have now been changed. {{History||1.11.0|snap=beta 1.11.0.1|Iron swords can now be found in savanna, snowy taiga, taiga and desert village weaponsmiths.}} {{History|||snap=beta 1.11.0.4|Pillagers and vindicators that spawn in raids can now drop iron swords upon death.
 * Golden swords can now be found in nether fortress chests.
 * Zombies now rarely spawn holding an iron sword that have a chance to dropped.
 * Golden swords are now rarely dropped by zombie pigmen.
 * Stone swords are now rarely dropped by wither skeletons.}}
 * Added vexes, which rarely drop an iron sword if killed using Looting enchantment.}}
 * Iron swords are now found in plains village weaponsmiths.}}
 * Trading has now been changed. Iron swords sold by weaponsmith villagers now cost 2 emeralds while diamond swords cost 8 emeralds as part of their fourth tier trades.}}

{{History|console}} {{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1|    Added swords (all five types).}} {{History||xbox=TU5|Added the ability to block, giving the player more options in combat.}} {{History||xbox=TU53|xbone=CU43|ps=1.49|wiiu=Patch 23|switch=1.0.3|Iron and golden swords are now smeltable.}} {{History|PS4}} {{History||1.90|    The textures of all swords have now been changed.}} {{History|foot}}

Trivia

 * The sword's texture came from Notch's abandoned RPG, Legend of the Chambered. The iron sword's texture was created first, as it was from the game, and the other swords followed.