#(hmoe) Persistent Data in Denizen
1 messages · Page 1 of 1 (latest)
(hmoe) Persistent Data in Denizen
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
Could you give a more specific example? as there are different solutions depending on what exactly are you trying to do
sure. let's say I make a sword with the name "My Sword":
type: item
material: diamond_sword
display name: My Sword```
and then i start giving it out to a bunch of players. There are hundreds. Thousands. Hundreds of thousands of people with this sword. `My Sword` becomes so cool and popular that I decide to change its name to `The Sword`, because of how much fame it has. So, I go back into the script file, and change the name. The script looks like
```server_sword:
type: item
material: diamond_sword
display name: The Sword```
But now, everyone who previously received the sword sees the name as `My Sword`, and any new instances of the sword say `The Sword`! Oh no! No one is sure what to call it now. Is it really a sword at all???
So to avoid all this, after I change the display name to `The Sword`, anyone who has the server_sword should see the name change to `The Sword`
Ah I see, asked because the solution would likely be different for non-display data - for your use-case I'd recommend 2 things:
- Probably the best option - use a resource pack with a translatable string, that way your actual display name would be
<&translate[the.sword.name]>, and in your resource pack you could map that to whatever you'd like.
And since resource packs can be automatically updated for a player every time they join the server, all you'd need to do is changethe.sword.name's translation in your resource pack whenever you'd like for it to automatically update (can even do cool things like having translations for multiple languages, which would mean the player would see the item's name in the language they have set on their client). - Potentially harder/more annoying option - just update them manually via a script, e.g. whenever a player joins, scan their inventory for the relevant items that need updating and modify them.
Can check more frequently ofc, technically can go as far as checking every single inventory change
I'll include that you seem to be under the pretense of loading data from the script again, but that uhh
wouldn't really work. Items work with a lot of metadata that can't afford to just be reset constantly
i.e in the sword example, durability wouldn't work because you're reloading a sword with maxed durability
Yeah dynamic values require a manual check or have to be excluded
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@primal tusk
/resolved
Need to use the slash command
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@primal tusk