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

Started by MelodyAutumn on

Topic category: Help with modding (Java Edition)

Last seen on 21:32, 19. Aug 2023
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

Last seen on 02:45, 27. Mar 2024
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?"

Last seen on 02:45, 27. Mar 2024
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?

Last seen on 21:32, 19. Aug 2023
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

Last seen on 02:45, 27. Mar 2024
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?

Last seen on 11:39, 28. Mar 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Last seen on 02:45, 27. Mar 2024
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.