What year used or rebuilt engines can I replace my Dodge Ram 1500 V-8's with? on 1999 Dodge Ram 1500

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
My 1999 Dodge extended cab Ram 1500 5.2 v-8 has a lot of miles on it and is using/burning a lot of oil. Was wondering if I should try to start looking for a used,or rebuilt engine, and what years, etc. should I look for to replace it.
(1) Answer
94-01 should be able to go in it. but make sure they have the same engine VIN number. i think its the fifth character and the 5.2 is a x i think, but dont quote me on that part.