Sword

Swords are melee weapons that are mainly used to deal damage to mobs and/or players. They also are useful for mining cobwebs.

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 Husk 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. Stone swords dropped by wither skeletons will always be unenchanted.

A vex wields an iron sword which 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 nor enchanted.

Pillagers and vindicators that spawn in raids have a small chance of dropping an iron sword, which will be badly damaged and can be enchanted with a random enchantment.

Trading
Weaponsmith villagers sell enchanted iron swords for 9–10 emeralds as part of their second tier trades, and enchanted diamond swords for 12–15 emeralds as part of their third tier trades.

Apprentice-level Weaponsmith villagers sell enchanted iron swords for 2 emeralds, and Expert-level weaponsmith sell enchanted diamond swords for 8 emeralds.

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

Natural generation

 * Notes

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

Attacking a boat or a minecart with a sword will instantly destroy it and will not decrease 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 will perform a "sweep" attack which can hit nearby enemies. Enemies near the hit enemy will be knocked back and damaged by from the slashing attack. The Sweeping Edge enchantment will increase 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 will be knocked back.

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

Bedrock and PS4 editions
In the Bedrock and Legacy Console editions, 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 in Java, 11 in Legacy Console editions and 13.5 in Bedrock Edition (without critical hits). This is because in the Console Edition, the damage is the same as that of the Bedrock Edition, but the sharpness enchantment is weakened like in the Java Edition since the 1.9 update.

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 will be dropped:
 * White: an original block.
 * Blue: block's normal drop (e.g. seeds, sapling, apple).
 * Red: nothing.

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

Blocking
All types of swords can be used to parry to block some forms of damage. If the player is a sword when attacked, the sword will deflect 50% of the incoming melee, non-magical projectiles like arrows and explosion damage, plus a bit of knockback. The sword is hold in front of the player and its durability is not reduced by blocking.

As 1.9 of Java Edition, this funcionality was replaced by blocking with shields. The player will also move at a slower rate than sneaking if blocking with a sword, nevertheless it blocks instantly, unlike the shields which have a 0.25 seconds cooldown period of activation.

Enchantments
Swords can receive the following enchantments:


 * Fire Aspect
 * Looting
 * Unbreaking
 * Sharpness
 * Smite
 * Bane of Arthropods
 * Knockback
 * Mending
 * Curse of Vanishing
 * Sweeping Edge

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

Video
''Note: This video is really seriously outdated. Since version 1.9, swords can no longer block attacks. And it's past 1.13.2 now! Instead, shields are used.''

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.