You need 500 melee kills. Once you hit that number, move to the next area and your pipe automatically converts into the sword.
The efficient way to farm it is to stand beside a teleporter, let four enemies spawn, and clear all four with the pipe before repeating. Enemies arrive in clusters there, which is what makes it faster than hunting them down.
On a hacked version you'll likely one-hit with the pipe anyway, which trivialises the grind.