block nbt doesn't save when i leave the world, any way to fix this?

Started by MelodyAutumn on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
block nbt doesn't save when i leave the world, any way to fix this?

like the title says, i have a block in my mod that has text nbt (storedCommand) that is given when a player types something into a text field and presses a button to save it as the nbt value, but it resets to simply nothing whenever i leave and re-enter the world. i don't have the nbt set anywhere unless that button is pressed so i don't know what's going on. any help is appreciated, cuz this is kinda a big issue

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did you make a block "Tile…
Sun, 01/22/2023 - 03:54

did you make a block "Tile Entity?"

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did you make a block "Tile…
Sun, 01/22/2023 - 04:06

did you make a block "Tile Entity?"
 

I meant: Did you use the print string text procedure and use it to print it as NBT data?

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it's set as a tile entity,…
Sun, 01/22/2023 - 07:27

it's set as a tile entity, but no, i didn't use the print block

here's my code, and the only time the nbt is defined (it runs when the button in the gui is pushed) and also the gui

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I see what's going on, The…
Wed, 02/22/2023 - 19:21

I see what's going on, The detector is not bound to the current block, therefore it acts like an Air block instead.
In order to store it's data, you need "X" "Y" and "Z" coordinates along with the sting value.
Did you put the coords on the "If" Statement?

GUI text field text is…
Wed, 02/22/2023 - 21:58

GUI text field text is client-side only therefore cannot be accessed from the server and saved.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
GUI text field text is…
Thu, 02/23/2023 - 01:05

GUI text field text is client-side only therefore cannot be accessed from the server and saved.


Hmm, I didn't know that, Thanks.