Minecraft wiki entry for Creating_a_data_pack, associated text: 4 for versions 1.13 – 1.14.4
5 for versions 1.15 – 1.16.1
6 for versions 1.16.2 – 1.16.5
7 for versions 1.17 - 1.17.1
8 for versions 1.18 - 1.18.1
9 for versions 1.18.2+