Help with assigning a random, custom text NBT tag to the player upon player joining the world.

Started by akrayniak on

Topic category: Help with modding (Java Edition)

Last seen on 05:23, 24. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with assigning a random, custom text NBT tag to the player upon player joining the world.

So I'm trying to create a mod based off of the Naruto series, and the first feature I'm trying to implement is one that randomly assigns the player to one of four clans. I thought I had the procedure set up correctly, however there seems to be an issue. So the procedure is set to trigger upon the player joining the world. After that it checks to see whether or not the player has already been assigned to a clan. If not, it generates a random number, between 1 and 4, assigns each clan to a value, and then assigns the player to a clan with a corresponding message, notifying the player which clanthey have been assigned to. However when I test this out, I do not see any message in-game upon creating and joining a world. Amy help here would be greatly appreciated. I can post the procedure set up too, I'm just not sure the right way to do that. 

Last seen on 02:56, 28. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think the logic you're…
Wed, 04/17/2024 - 13:14

I think the logic you're describing is sound, but make sure the returned value for your randomized clan is being stored to a PLAYER_PERSISTANT string variable that has a distinct initial value that wouldn't be polled on accident/create false positives (i.e., not having the initial value be blank or a space char or something).

Last seen on 05:23, 24. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe I've done that…
Wed, 04/17/2024 - 23:00

I believe I've done that. Could be wrong though, here's what the procedure actually looks like. https://imgur.com/a/125GoYB