Block entity_nbt_num_get is not synced between client and server automatically

Started by Owls_Parliament on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Block entity_nbt_num_get is not synced between client and server automatically
Mon, 10/06/2025 - 15:45 (edited)

I'm getting an error on one of my mods that reads "Block entity_nbt_num_get is not synced between client and server automatically, which means it may not work properly in some cases" and I think someone online who downloaded my mod has encountered such an case. Does anyone know how to ensure this is synced between client and server correctly and to prevent the error from showing up (or at least affecting gameplay)?

Edited by Owls_Parliament on Mon, 10/06/2025 - 15:45
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do you know what block…
Mon, 10/06/2025 - 17:31

do you know what block/procedure is causing it?

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah the warning will appear…
Tue, 10/07/2025 - 07:38

yeah the warning will appear on all procedures that use the nbt blocks. I meant, do you know which procedure caused the bug for the user?

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not specifically one, but it…
Tue, 10/07/2025 - 15:18

Not specifically one, but it's one of a few that are called at once. I know the error they got, at least. If you have more experience reading error messages than I do, then please feel free. I am doing my best with it.

This is the error message:

 

[16:07:35] [Netty Client IO #1/ERROR]: Network Exception Caught

 

java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.CompoundTag.m_128471_(String)" because "nbt" is null

 

at net.mcreator.owlspocketdimension.network.OwlsPocketDimensionModVariables$PlayerVariables.readNBT(OwlsPocketDimensionModVariables.java:302) ~[OwlsPocketDimension-v1.0.2_Forge-1.20.1.jar%23516!/:?]

 

at net.mcreator.owlspocketdimension.network.OwlsPocketDimensionModVariables$PlayerVariablesSyncMessage.<init>(OwlsPocketDimensionModVariables.java:325) ~[OwlsPocketDimension-v1.0.2_Forge-1.20.1.jar%23516!/:?]

 

 

They said the error occurred whenever they exited and entered my custom dimension. That would use these procedures here (plus the one I already sent):

https://drive.google.com/file/d/1YndWvzceJQYD2t2ODzQ68GG2ikfmVbXS/view?…

https://drive.google.com/file/d/1BEao0MUSS2Xyrm8UFV-fM9OlsEu2umvG/view?…

 

https://drive.google.com/file/d/1D1cBQZWwOIHLi5oitMeVP8otgsCt-fPl/view?…

 

Two of those are screenshots of the procedures, the last one is the primary procedure (the screenshots cut off part of the procedure despite how far I zoomed out, it cut off part of a spawn particle block and part of a teleport command).

It's one of these (or the one I sent in my last post), as these are all the procedures called when a player moves to and from the custom dimension, which is when the user said they got kicked from their server.

 

I can see that the error points to specific lines of code "java:302" and "java:325" but I don't know how to locate which procedures those are with MCreator.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am mostly shooting in the…
Tue, 10/07/2025 - 15:25

I am mostly shooting in the dark trying to diagnose this error. I suspect it might be the warning on MCreator pointing to the same thing, but I am uncertain. As noted, if you can read this error message better than I can and better point me in the right direction, I would be grateful. I'd like to fix the error in the procedures regarding nbt data not syncing whether or not that is the cause, but I crucially need to fix the error this user encountered, if that is possible.
Either way, whether you can help or not, I appreciate the prompt replies and attention.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm pretty sure you can't…
Tue, 10/07/2025 - 15:34

I'm pretty sure you can't get rid of the nbt warnings.

 

hm I don't see how it'd be null,,,

looks like you're looking for an nbt logic block

 

 

Have you been able to recreate the bug yourself?

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't have a hosted server…
Tue, 10/07/2025 - 17:34

I don't have a hosted server or friends to test it at present, so unfortunately no. I've never encountered it before myself, either. They said it didn't happen on single player or when they were alone on the server, so it may have something to do with multiplayer / having more than one person online.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://mcreator.net/comment…
Tue, 10/07/2025 - 18:57

https://mcreator.net/comment/296695#comment-296695

are you even using logic nbt anywhere in the procedures you sent? I just had a look and I can't see any.......

 

You can test it in multiplayer on your own by exporting your mod, then starting a server from MCreator (which also starts a minecraft client) and finally starting another minecraft client with a regular minecraft launcher and your exported mod

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Only custom nbt number tags…
Tue, 10/07/2025 - 21:23

Only custom nbt number tags within procedures. I am using a boolean variable for each player that is player-persistent with an initial state of false, so I don't know how those would be null. But that's all I can think of as being at fault.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'll do what you suggested…
Tue, 10/07/2025 - 21:28

I'll do what you suggested and see if I can replicate the crash in the meantime.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I didn't manage to replicate…
Tue, 10/07/2025 - 22:47

I didn't manage to replicate being kicked from the server, but I think I might have found the issue that has led to their being kicked on their end (despite for some reason not being able to log into the server from another client, maybe something to do with running both clients on the same computer--I don't have another one). Or at least it is an issue. On either server or starting an LAN world, player-persistent global variables seem to just fail for some reason and cease functioning, resulting in some weird fall-through issues that do not happen on single-player worlds or any of my other testing.
I guess it's because player-persistent variables are stored on the client side? That might explain why when they re-log or restart their game, the are able to clear the issue. Is there a way to ensure everything is synced on the server side, or should I be investigating another method?
Do entity nbt values persist after player death? I don't know of very many workarounds for this. My mod relies on knowing where the player has been and certain data associated with that.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No when the player dies the…
Wed, 10/08/2025 - 10:35

No when the player dies the nbt tags will be cleared. The global variables shouldn't, and they are stored both server and client side and synced when set.

You should be able to join the server MCreator with both clients...
Like so lets say you have prism launcher, you export the mod from MCreator, add it to one of your instances and run that client. Then you start the server with MCreator, thus also starting another client.
Then in the console for the server you will find a line like [12:32:37] [Server thread/INFO] [minecraft/DedicatedServer]: Starting Minecraft server on *:25463

So then in the client that wasn't started by MCreator you'd join localhost:25463

Sorry if you already knew all of this and I just misread your message.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, that is helpful. I did…
Wed, 10/08/2025 - 15:38

No, that is helpful. I did not know any of that. Thank you.
I have confirmed that their error resembles my own experience with inconsistent, occasional desync of the server and client reading the player-persistent variables. Reading MCreator documentation, Player-Persistent Variables are primarily client-sided. So I don't know that it's my fault. Technically. But I think I might explore using something like the File Manager plugin to make an external database that can be read server-side (client doesn't need to know most of the information), but I have no experience with anything like that. I guess I could search for tutorials.

Thank you for your help. I appreciate it immensely. If you think of something else I am all ears, but I'm getting the sense that this may not be strictly the fault of my system and more a consequence of an inconsistent server/client miscommunication.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah just one thing though…
Wed, 10/08/2025 - 15:45

yeah just one thing though global variables are primarily server-sided and then synced to the client,

"from the server to the clients"