Suppose you have three files
File 1 only exports variables
In File 2 and File 3, you can change the values of the variables and print them out respectively
If you change the value of a variable in file 2, the output of file 2 is normal, but file 3 still does not change the value of that variable
Conversely, if you change the value of a variable in file 3, the output of file 3 is normal, but file 2 still has the value you changed previously
Expected Behavior:
Exported variables share values
Actual Behavior:
Exported variables are not shared
How to Test:
1. Apply pack and create world
2. Follow the steps below to chat (ignore the instructions in parentheses)
1 (Set the value of variable 1 to 1 in file 2)
print (Print the values of the variables in file 2)
print2 (Prints values of variables from file 3)
13 (Set the value of variable 1 to 3 in file 3)
print (same as described above)
print2 (same as described above)
3. If you checked the bug in the chat above, change the number and check other kinds of variables
Test File:
Comments 3
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
Is this still an issue in the latest version? If yes, could you please add it to the affected versions (or mention it if you are not the reporter)?
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki
Works as expected
When you assign a new value to a variable, that variable only changes for one file and not for other files.
If you want it to change across files, use objects instead, and change the property value inside that object, so it changes across files.