Fix external bug (due to datapack), and prevent other bug