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've try to record something about the player with NBT, like level or something like that.

But when the player dead, and respawn, all the record seems to be clear.

I want to keep the information of the player after his death. Which code should I check for?

check for IExtendedEntityProperties

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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

  • Author

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?

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.