Jump to content

NBT information lost on player dead


zerozhou

Recommended Posts

As I recall information in the players IExtendedProperties also are wiped upon death.

 

Since we are talking about storage of information for use during runtime, you could just store the information anywhere you want between his death and his respawn.

Isn't that a simple solution? :)

 

Never forget that despite the number of weird things that goes on in Minecraft's code; it's still just Java :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Maybe I found how to do this with forge as I found a code like this in EntityPlayer

        //Copy over a section of the Entity Data from the old player.
        //Allows mods to specify data that persists after players respawn.
        NBTTagCompound old = par1EntityPlayer.getEntityData();
        if (old.hasKey(PERSISTED_NBT_TAG))
        {
            getEntityData().setCompoundTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG));
        }

Which would be called when the player is respawn.

It seems that I need to record the data with the key PERSISTED_NBT_TAG and add a new NBT node here. Am I right?

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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