Help me understand player NBT tag and server syncing

Started by DragonUtopia on Thu, 09/01/2022 - 09:23

Topic category: Help with MCreator software

Last seen on 23:23, 23. Oct 2022
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Help me understand player NBT tag and server syncing
Thu, 09/01/2022 - 09:32 (edited)

I’m new to modding and I’m making a mod which adds various player effects. These effects are controlled through the player’s entity nbt number tags but I notice a warning saying nbt number tags aren’t synced between client and server automatically. 

I mainly use the tags to check if and at what level an effect should be applied, e.g:
If player nbt number tag > 0 set player speed to nbt number tag

Example procedure

Better quality: https://ibb.co/0F0HLpq

The nbt tag is applied by right clicking while holding a consumable item with the nbt tag on it, which it gets by putting it in a machine. 

I have some questions: 
1. Is it necessary to sync these nbt tags to the server or can they be run client side? 
2. If yes do i just use the “wait x ticks and then on server side do”? (Do I need to set the tag both server and client side in my procedure or only server side?)
3. Do I just open the game to Lan to check if my mod works on a server? (I have already tried this and it worked with no problems)

I have more than 80 different effects and it would be a huge mess to use global player variables.

Edited by DragonUtopia on Thu, 09/01/2022 - 09:32