Chosen Solution
engine knocks bad when hot only when trying to go slow like a drive through. put in neutral and give a small rev and it stops.
First things first, get it scanned and see what codes come up. Knocking implies bearings, usually big ends and it doesn’t usually go away with a rev. But what you call knocking I may call pinging. So are you saying it sounds like an old diesel with that death rattle they have in the top end. Or are you saying it has a dull thudding noise coming from the bottom end?