Sword

Swords are melee weapons that are mainly used to deal damage to mobs and/or players.

Mobs
Some monsters can spawn with a sword, and have a 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 can drop iron swords, zombie pigmen can drop golden swords, and wither skeletons can drop stone swords. It will usually be badly damaged, and may be enchanted.

Trading
Weapon Smith villagers sell enchanted iron swords for 9–10 emeralds as one of their second tier trades, and enchanted diamond swords for 12–15 emeralds as one of their third tier trades. The enchantments will be the same as might be obtained from an enchantment table at levels 5–19.

Attacking
Pressing while holding a sword will increase your damage to both mobs and players. Upon damaging a mob or player, the sword's durability will decrease.

Attacking a boat or a minecart with a sword will instantly destroy it and will not decrease the sword's durability.

Blocking


Swords are able to block attacks by holding. This will reduce most damage by 50% and will reduce the player to a speed slower than sneaking. As of 15w33c, swords can no longer be used for block. Instead, shields are used.

Damage
The following table summarizes the damage that swords of different materials inflict. Enchantments can change these statistics.

Critical hits add a damage bonus of 50%, before sword enchantments.

The formula to find the minimum of the total lifetime damage is Durability × Damage per hit = Lifetime damage minimum. The formula to find the maximum is Durability × Critical Hits = Lifetime damage maximum.

Sword digging 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.

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

Enchantments
Swords can receive the following enchantments:


 * Fire Aspect
 * Looting
 * Unbreaking
 * Sharpness
 * Smite
 * Bane of Arthropods
 * Knockback


 * Notes

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.
 * When blocking, the player's vertical movement speed does not decrease. This applies to flying, falling, swimming up or sinking, and climbing ladders.
 * A foam iron sword can be purchased on the merchandise page of minecraft.net.
 * 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.