- changed status to open
Share saved variables between multiple mobs
So far, saved variables are saved for one mob only, which means that when using the same script entry on a different mob, you will get a completely blank state. While this has its benefits, it would make more sense to share saved variables across mobs that use the same script entry.
The current save model saves a new NBT tag on the mob that's interacted with, but you could save the NBT tag on the mob talker item instead, making it possible to access the same data across multiple mobs. This would, however, make it impossible to access other players' saved variables in multiplayer!
Also, if possible, this save behaviour should be made configurable, so as to not break existing scripts.
The attached script pack should allow to determine if this issue was implemented correctly or not.
Originally reported here.
Comments (6)
-
reporter -
reporter - edited description
-
reporter One way to implement the new functionality but keep the old one of accessing other player's variables in multiplayer would be to split the saved variables:
savedVariables
would be stored as NBT tags for the mobsavedVariablesPerPlayer
would be stored as NBT tags for the mob talker item
This way, the
savedVariables
would still be accessible cross-player (which they used to be before) and thesavedVariablesPerPlayer
would now be accessible cross-mob. -
reporter - changed milestone to 0.7.6
-
reporter - changed milestone to 0.7.7
-
reporter - changed status to resolved
Resolved in commit 7d431d1a9b83bc02a6557a3498c90f092d5c93d8
- Log in to comment