Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'd like to understand more about how minecraft saves data.  I know there is NBT reads and writes but I don't think that is used for everything is it?  Let me use an example for my question.  On EntityLiving is this member:

 

protected PathNavigate navigator;

 

It holds a variable that I know persists across saves and reloads of the game:

protected Path currentPath;

 

So how is this data saved?  I don't see any NBT read/write code for it.  Does it do something like serialize and write the whole Entity object out to file? 

 

Any help to understand this would be great.

 

37 minutes ago, MrChoke said:

I know there is NBT reads and writes but I don't think that is used for everything is it?

It is used to save everything, what logical thought process would lead a developer to create two different types of saving methods for one game?

 

39 minutes ago, MrChoke said:

It holds a variable that I know persists across saves and reloads of the game:

How do you know said variable persists?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

3 hours ago, MrChoke said:

So yes I agree, it must only be NBT reds/writes that get things saved.  Turns out that path var and many other things actually get re-initialized from scratch when a world is loaded.

 

So if I want to save my own data to the a save, I guess I use what is explained here:

https://mcforge.readthedocs.io/en/latest/datastorage/worldsaveddata/

 

Or capabilities

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

4 minutes ago, Cadiboo said:

Or capabilities

Capabilities just wrap around World Saved Data. However it may need to be an entity capability if it is something like the provided example.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.