Preserve player NBT after leaving/joining the world.

Started by dja303 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Preserve player NBT after leaving/joining the world.

So I was making a mod to implement radiation. What it does is it stores the amount of "rads" the player has in an NBT tag however this gets reset when the player leaves the game. I know you could do this with a PLAYER_LIFETIME variable, however, I'm using mcreator version 2021.1 with the 1.12.2 generator plugin and when I make a PLAYER_LIFETIME variable... it just doesn't generate the code. Is there any workaround I could do to fix this? or better yet is there a way I could implement such a variable manually? I was making this mod to top off a modpack I'm working on so unfortunately I'm kinda stuck on 1.12.2, but if I could just get past this roadblock I could continue working on it.