(±SOLVED) NBT tags for an entity are reset when re-entering the world

Started by ImSeyo on

Topic category: Help with modding (Java Edition)

Last seen on 18:44, 23. Apr 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(±SOLVED) NBT tags for an entity are reset when re-entering the world
Sun, 03/24/2024 - 14:48 (edited)

I have created several numeric NBT tags for an entity that assign a random number from 70 to 100 when the entity appears. Everything works, but when I re-enter the world, the NBT tag starts picking up a new random number again. I tried to make a check that if the entity appeared and "noSpawned" = false, then change it to true and pick a random number for numeric NBT tags. When you re-enter the world, the same error appears. It feels as if all entities will spawn at the same time when the player enters the world and therefore the procedure reacts to it. 
I tried using variables, but it didn't work out.

Edited by ImSeyo on Sun, 03/24/2024 - 14:48
Last seen on 18:44, 23. Apr 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok. I found information that…
Sun, 03/24/2024 - 07:52

ok. I found information that NBT tags are not saved. But then what should I do? The global variables player persistent and player lifetime only work for the player, although I need to use this for the mob. I also tried using the scoreboard, but it didn't help.

Last seen on 18:44, 23. Apr 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
stored entity data? This is…
Sun, 03/24/2024 - 13:49

stored entity data? This is the first time I've heard of them. Can you tell me where it might be? I didn't find it. or do you mean the procedural block "For custom entity [event/target entity] of type... set data parameter"? If yes, then it doesn't suit me, so it applies to a custom entity, and I use villagers

Last seen on 18:44, 23. Apr 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I decided to combine nbt…
Sun, 03/24/2024 - 14:12

I decided to combine nbt tags with scoreboard, and I managed to keep the values even if the player enters the world. but there was another problem. I wanted to output these values to a separate interface, but now it always shows 0, even if I try to get the value of the NBT tag and the scoreboard. But the most mysterious thing is that when I try to send a text to all the players with these values, there is no problem, there is no value 0.

Stored entity data is a tab…
Sun, 03/24/2024 - 18:59

Stored entity data is a tab in living entity mod element editor where you define custom data entries that are synced and stored to game save for you