Some text from Minecraft Wiki used under Creative Commons Attribution-Share Alike License 3.0
|Uses||Wood: 60 Stone: 132 Iron: 251 Gold: 33 Diamond: 1562|
|Data Values||Hex: Wooden: 10C Stone: 110 Iron: 10B Gold: 11B Diamond: 114 Dec: Wooden: 268 Stone: 272 Iron: 267 Gold: 283 Diamond: 276|
The sword is a short range weapon - despite its appearance, it grants no range advantage over any other tool since Beta 1.9, including bare hands. Swords used to inflict more damage than bows - often significantly more depending on material, and even a wooden sword was on par with an arrow, but since the Beta 1.8 update, there are no (non-enchanted) swords that match a full-charged arrow (with a non-critical hit). A way to use swords without being hit (and thus closing the gap between swords and bows) is to dig a trench such that the player's head is the same level as the mob's feet. The player must of course have blocks over his 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, but is nearly useless when exploring except for whenever the player encounters the 2-block wide spider .
High damage swords are primarily advantageous because they kill mobs in fewer hits, defeating them faster and thereby reducing the chance of the Player being damaged in return. For the same reason, you will swing these swords fewer times in the long run, reducing the rate at which durability is expended. Unless the player engages in combat very frequently, swords in general will see a far longer useful life. A diamond sword's damage of 8 HP over the iron sword's 7 HP is also a much bigger difference than the difference between the numbers may imply as it guarantees a kill of any mortal thing in fewer hits, and any passive mob in one. The ability to kill rapidly is of greatest benefit against creepers and ghasts when the time to act may be very short. These factors combined make a diamond sword a compelling investment.
The weaker swords are not recommended for Creeper combat (especially on normal or hard) and there are strong arguments for using a bow , owing to its range (provided the bow is at full charge). If you approach a creeper with a sword, a recommended strategy is to use hit-and-run tactics. Hit the creeper and run away until the hissing stops, then run forward and hit it again, as many times as necessary. With a diamond sword, however, one may simply charge at the creeper whilst swinging it, as the 2-hit-kill allows the player to kill the creeper prior to their "fuse" running out. Be wary, as this is a risky tactic that could go horribly wrong if failed, often ultimately leading to the demise of the player or items and terrain around them.
With the ability to sprint added in Beta 1.8, swords became a more effective tool in combat: when a mob is hit by the player when sprinting, they are sent flying several blocks back because your momentum is added to the mob's momentum. This is quite useful when fighting creepers. Charge at them in a sprint and hit them, they get knocked back to a safe distance before they could even initiate their self-destruct countdown, just repeat until the creeper dies. Just make sure there is room behind the creeper and that it does not get knocked back into an obstacle for maximum effect. This tactic basically eliminates the need to run backwards before going for another hit. This tactic is not recommended for tight areas such as caverns and other tight spaces, only do this when you encounter a creeper in the open.
A sword with the knockback enchantment is also viable for the hit-and-run tactic, as it sends any mob flying back a few blocks when hit. This can replace sprinting, or even complement it, resulting in a greater effect. If a diamond sword is being used, this can make creeper disposal very easy. Along with the sprint tactic, this is not recommended for use against Skeletons , as it grants them a free shot while you continue to approach them.
Players are advised to make use of the critical hit ability of the sword to dispatch of mobs, especially creepers, quickly. A difficult, but effective maneuver is a combination of both knock-back and critical hits, sprinting towards the enemy before jumping and landing a blow on them before landing. This will both deal heavy damage and knock the mob far back, fall damage often finishing the mob off. Sprinting is also good for closing the distance on skeletons and ghasts, but make sure to not hit them while you are sprinting or they will get knocked back, allowing them a free shot at range.
As of Beta 1.8, swords are able to block attacks by holding the right click button. This will block 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 in the beta 1.8 update (like before Beta 1.5) but was increased by 1 HP in release 1.6.
A sword is a melee weapon- a weapon that can only be used in close combat. Because of this, they aren't recommended for fighting creepers, skeletons, or ghasts . A player can swing a sword by left-clicking while holding it. One good way to deal with these or any other hostile mobs is to run to them, strike them with your sword, then run back and repeat until they are defeated. A player could also hit critical strikes on the mobs by jumping and striking it with the sword on the way down. As of Beta 1.8, a player could block an attack with a sword by right-clicking while holding it. While doing this, a player will take half the damage of the attack. They could also be enchanted using an enchantment table to increase their advantage, and can have abilities added to them by using an anvil and an enchanted book.
Here is a list of possible sword enchantments: