Title. I have some features that allows you to level up and the values are stored in Kubejs variables. However, when the server shutdown or the player leaves their single player world the value reverts back to what it was before they leveled up. So is there a way to keep the value of the changed variables? Any help would be so so appreciated.
#Is there a way to make the changed value of a variable remain after you shutdown the world/log off
10 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
event.server.persistentData.someValue = 20
or if you want per player, event.player.persistentData.someValue = 22
okay sweet. How would I get the value of that variable if I wanted it later?
event.player.persistentData.someValue
console.log('someValue='+event.player.persistentData.someValue)
Is this feature present on 1.18 as well? I'll definitely need something like this in the future
yes
nice, thank you