Global Variables don't save when I join back into a world

Started by Kylebutter123 on Sat, 06/02/2018 - 19:54

Topic category: Help with MCreator modding

Last seen on 14:57, 28. Aug 2018
Joined Dec 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Global Variables don't save when I join back into a world
Sat, 06/02/2018 - 19:54

Everytime I edit a variable in my world, quit minecraft, then join back into the world, the variable doesn't save

 

can anyone help with this problem..?

Last seen on 23:58, 10. Nov 2018
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
You can use WorldSavedData…
Mon, 06/04/2018 - 05:21

You can use WorldSavedData for world related variables, Capabilities for entity/item related variables or you can do your own system.

Last seen on 14:57, 28. Aug 2018
Joined Dec 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
does using WorldSavedData…
Sun, 07/22/2018 - 22:03

does using WorldSavedData require any manual coding?

Last seen on 23:58, 10. Nov 2018
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Of course that it does. You…
Sun, 07/22/2018 - 22:54

Of course that it does. You have to create the class that extends the WorldSavedData.class, override few methods regarding the NBT read and write + you have to create an event handler to load the data on world load.