Main article: Drops § Equipped items
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. The dropped sword is usually be 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 HandDropChances is 0. However, this chance increases by 1 percentage point per level of Looting. It is never damaged[Java Edition only] and may be enchanted.
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.
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.[Legacy Console Edition only]
Apprentice-level weaponsmith villagers sell enchanted iron swords for 2 emeralds, and expert-level weaponsmiths sell enchanted diamond swords for 8 emeralds.[Bedrock Edition only]
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.[Java Edition only]
The enchantments are the same as the ones obtained from an enchantment table at levels 5–19.
Iron swords can be found in 12.1% of stronghold altar chests, 25.6% of village weaponsmith chests, and 75.0% of buried treasure chests, all in groups of 1.
In Bedrock Edition they can be found in 11.8% of stronghold altar chests in groups of 1.
Golden swords can be found in 19.0% of fortress chests in groups of 1.
Enchanted iron swords[note 1] can be found in 13.3% of End city chests in groups of 1.
Enchanted diamond swords[note 1] can be found in 13.3% of End city chests in groups of 1.
Enchantment probabilities are the same as a level-20 to level-39 enchantment would be on an enchantment table that had no cap at level 30, and that was able to apply treasure enchantments, and where the chance of multiple enchantments is not reduced.
Pressing attack 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.
This feature is exclusive to Java Edition.
If the attack recharge meter is 84.8% or above, and the player is standing or moving no faster than walking speed, the sword perform a “sweep” attack that can hit nearby enemies. Enemies near the hit enemy are knocked back and damaged by 1♥ 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.