Player Persistent Entity NBT Numbers + a little more

Started by FragantA4sheet on Sun, 01/23/2022 - 10:50

Topic category: Help with modding (Java Edition)

Last seen on 00:33, 3. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Player Persistent Entity NBT Numbers + a little more
Sun, 01/23/2022 - 10:50

Hi, new here, just made an account because I got a little stuck with the following and searching didn't seem to be very fruitful. I hope it's not too long!

As a preface:
This is Mcreator version 2021.3 and I'm making the mod for 1.17.1

I had initially created a levelling and mana system using global variables and advancements, but decided I would rather have Nbt tags set to players specifically (I assume global variables would affect multiplayer which is the reason I'm doing it this way?).

The problem & questions.

1) I know I can set a NBT logic/number etc to an entity in the procedures section, but where/how do I define it to be player persistent? I DID find an earlier post detailing that there is a drop down for this, but can't for the life of me find it.

--- Other related questions ---

2) Is it possible to define or at least view NBTs and their attributes (Like how global variables are viewed) elsewhere outside of the procedures section? Or do I simply use Set [event/target entity] data number NBT tag ["tagName"] to [0] on event "When player joins world" as a trigger or something like that? Does doing it this way also simultaneously define "tagName's" value that can be called across multiple procedures?

3) Is it possible to add a custom event trigger when an NBT tag reaches a certain value/threshold? I've tried this with global variables, when reaching a certain number to set another global number variable to a higher number.

Extra question:
4) Is there a way to not spawn vanilla trees in custom biomes when my custom grass block has the "grass" tag. Essentially, I want to limit vanilla options/materials in specific biomes and dimensions. (If there is a way to simply ban spawning of vanilla trees via dimension ID that would work too).

If the only solution is to simply remove the grass tag and add custom made trees set as structures -> import then and set to # of structures per chunk let me know because that's all I've seen so far...

Last seen on 00:33, 3. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Edit*  It seems that I just…
Mon, 01/24/2022 - 12:37

Edit* 

It seems that I just read Entity NBT will be client side and not synched to server. Does this mean for the levelling + mana system I am thinking of doing I need to either:

1) Synch client NBTS to server

2) Use variables that are synched but also player specific?

If so how do I do either of those in Mcreator?

Last seen on 05:12, 14. May 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
There's a global variable…
Mon, 01/24/2022 - 15:07

There's a global variable called PLAYER_LIFETIME and PLAYER_PERSISTENT.

Both are synced to server side

https://mcreator.net/wiki/variables

Last seen on 00:33, 3. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks, that's what I have…
Mon, 01/24/2022 - 15:42

Thanks, that's what I have currently but are these variables player specific?

For instance If one were to run this in a multiplayer based server, would the global variable update and apply to all players instead of just each specific player?

That's the reason I'm looking at the NBTs in the first place if it able to have that player specificity. E.G One player can be "level 1" and another can be "level 2".

Last seen on 05:12, 14. May 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Player_persistent/lifetime…
Tue, 01/25/2022 - 01:23

Player_persistent/lifetime variables are player specific

Last seen on 05:12, 14. May 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Player lifetime will reset…
Tue, 01/25/2022 - 01:24

Player lifetime will reset upon players death btw. If you don't want it to reset use player persistent

Last seen on 00:33, 3. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Awesome, then I wouldn't…
Tue, 01/25/2022 - 08:07

Awesome, then I wouldn't need to fiddle with NBTs for this specific system. Cheers.

Do you also know if there is a way to disable vanilla spawning of trees in a custom biome but also having the "grass" tag on any custom grass blocks?