Achievements and Saving

Started by dochaon on

Topic category: Help with modding (Java Edition)

Last seen on 20:30, 19. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Achievements and Saving

I am currently working on a mod for 1.14.4, which brings aspects like magic and such to the game. At the moment I am working on a Mana system. Basically, Mana regenerates slowly, until it reaches the Maximum(curently a global_session.). This maximum can be increased by using certain items. Seeing as session variables don't remain when the player closes the game, I  thought of a way to save and load the maximum Mana for a player. When the player uses an item to increase the maximum, it gives the player an achievement based on how high the variable is (it always increases in steps of ten, as to keep it a bit more organised). Whenever a player loads into a world, the game checks which achievements the player has, and gives them a maximum Mana number based on these. Unfortunately the game crashes with a tick execption when I try to load a world. I tried removing different things and it seems the Problem is that trying to check for custom variables crashes the game. If anyone knows or can think of a solution, it would be greatly appreciated.

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this is a very hacky way to…
Mon, 05/11/2020 - 15:09

this is a very hacky way to do this, use nbt instead.

Last seen on 20:30, 19. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the answer. I…
Mon, 05/11/2020 - 19:07

Thanks for the answer. I actually used nbt starting out. I think I abandoned it due to nbt resetting itself on game launch, which seems stupid now as globals do the same. Should I try the same way with nbt, or am I completely missing the point here? 

Last seen on 20:30, 19. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just realised what you…
Tue, 05/12/2020 - 11:56

I just realised what you meant. Thanks a lot!