Sword

Swords are craftable weapons used to damage mobs or other players and entities, or to block attacks (by holding the "use" key or right mouse button). Swords can also destroy certain blocks more quickly than any other tool (such as cobwebs).

Mobs
Some monsters can spawn with a sword, and have a 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.

Trading
Iron and diamond swords can be bought from Weapon Smith villagers for Emeralds, as a second tier and third tier trade respectively. They are enchanted with a level 5-19 enchantment.

Usage
Swords are used to damage both mobs and players, or to block attacks. Upon damaging a mob or player, the sword's durability will decrease. However you may repair a sword by combining it with the proper material in an anvil. 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 the equivalent of two strikes to a mob.

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

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 up to 50% (rounded down), plus one heart.

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

Combat
Despite its appearance, the sword grants no range advantage over any other tool, including bare hands.

Iron and stone swords kill most mobs in the same amount of hits. A diamond sword's damage of 8 over the iron sword's 7 is a much larger difference than the numbers imply, as it guarantees a kill of nearly any unarmored aggressive mob.

A way to use swords and other swung tools without being hit is to dig a trench such that the player's head is the same level as the mob's feet. The player must have blocks over his or her head so that mobs do not come into the trench. It is then possible to hit mobs without them seeing the player: this prevents mobs from retaliating. This method is efficient when defending a fortified building. It will not work against spiders unless slabs are placed on the ground in front of the trench, and skeletons at a distance may still have line of sight and keep shooting.

Unless the player engages in combat very frequently, swords in general will see a far longer useful life than a pickaxe or a shovel, which may mean swords are a more efficient use of rare resources (like diamonds and enchantments). Many players find that a diamond sword tends to outlast them, never being spent entirely but instead lost only due to accidental death.

Players with access to a bow and plentiful arrows will want to use them instead of swords for creeper combat when possible (especially on normal or hard), due to the range preventing the creeper from even beginning their detonation sequence. If you approach a creeper with a sword, use a hit-and-run tactic (run up, hit, run away until the hissing stops, then run forward and hit again). Swords with the knockback ("Knockback") enchantment aid these situations. When a mob is hit by the sprinting player, they are sent flying back further, which further increases the odds of a kill without much if any harm to the player.

A difficult but effective maneuver is sprinting towards the enemy before jumping and hitting in midair. This will both deal heavy damage and knock the mob far back, fall damage often finishing the mob off.

Ranged enemies like Skeletons and Ghasts will use knockback inflicted on them as an opportunity to fire, so knockback is a far less effective strategy when dealing with those enemies.

Swords are able to block attacks by holding the right mouse button. This will reduce damage from arrows as well as other projectiles, but will reduce the player to a speed slower than sneaking. Swords and all other player-dealt damage were also reduced by half a heart.

Trivia

 * The sword's texture came from Notch's abandoned RPG, Legends 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.