Engine problem

My engine sounds like a piston is misfiring. It sputters and sounds like a knock when I am in drive. But when it's in neutral/park it runs just fine, no sputtering or nothing. I changed the spark plug wires and the spark plugs, I didn't change the distributor but I figured that wasn't the problem. If any body's knows what's up that be great thanks!