2

Old Datapack to 1.20.2+ syntax updater python script

GetSirius55's Avatar GetSirius5512/1/23 2:51 pm history
2 emeralds 272 5
12/3/2023 3:11 pm
imalittlhigh's Avatar imalittlhigh
Hey I know that a lot of people may have made datapacks pre-1.20.2 and the syntax change. With the syntax change going forward from 1.20.2 everyone's datapack code will have to be different. I have made a simple python script to update datapacks made before the syntax change. You can just insert the directory of the folder you want to update and run the script. The script will automatically rewrite all the files so that it is in the new format. I suggest making a copy of your code and then updating the copy as this will rewrite your code with no going back.



The link below goes to a public Google Drive file that include instructions on how to use. Please leave any comments on the file or here to let me know if any changes are needed. Also please let me know if it works well for you in a comment here if you can. I like to know if people use this.


Google Drive Link - Python Code File
Posted by GetSirius55's Avatar
GetSirius55
Level 48 : Master Engineer
30

Create an account or sign in to comment.

5

imalittlhigh
12/03/2023 3:11 pm
Level 62 : High Grandmaster Sweetheart
history
imalittlhigh's Avatar
did i miss something? what syntax was change from 1.20.1 to 1.20.2?
Or is this for pre 1.20 packs?

*im dumb, i just didnt scroll far enough to see the updates ^^*
1
Restorish
12/01/2023 3:20 pm
Level 33 : Artisan Architect
Restorish's Avatar
so its like a datapack updater?
1
GetSirius55
12/01/2023 4:46 pm
Level 48 : Master Engineer
history
GetSirius55's Avatar
Exactly what it does. Updates your data packs to be 1.20.2+ compatible. If you have a large datapack with a ton of files, it would take forever to update every change like this. I just made a "find and replace" script so that you can just run it and it will do all the changes for you over your entire datapack. Then you don't have to do that huge task manually.





A few of the changes in 1.20.2 Change Log




A few of the technical changes (Dropdown list of examples, click here)
  • Id -> id, also changed from number to string id
  • Ambient -> ambient
  • Amplifier -> amplifier
  • Duration -> duration
  • ShowParticles -> show_particles
  • ShowIcon -> show_icon
  • HiddenEffect -> hidden_effect, also since it's mob effect instance, changes apply recursively
  • FactorCalculationData -> factor_calculation_data

A few not mentioned that got changed too:


'Id:3b' -> 'id:"minecraft:haste"'

'id:3b' -> 'id:"minecraft:haste"'
1
Restorish
12/01/2023 4:53 pm
Level 33 : Artisan Architect
Restorish's Avatar
oh ok thx ill use this
1
GetSirius55
12/01/2023 2:55 pm
Level 48 : Master Engineer
history
GetSirius55's Avatar
Mac Copy Path Instructions:
Open Finder and and navigate to the directory with the folder with your datapack folder in it
Right click on the datapack folder
Hold the option/alt key (It's the same key, two names) so that "Copy" shows as "Copy as Pathname"
Then click "Copy as Pathname", paste that below for the directory varaiable.




Windows Copy Path Instructions:
Open File Explorer and navigate to the directory with the folder with your datapack folder in it

Click once on the address bar at the top of the File Explorer window. This will highlight the entire path.

Right-click on the highlighted path, and a context menu will appear.

Select "Copy" from the context menu. This will copy the full path to your clipboard.



1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome