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'm working on a mod to help myself and my friends with a playthrough that we have planned, but I've hit a roadblock with it.  I am not very good with java and it's a miracle I've gotten this far.

 

My Question: How can I load a player's .dat file, modify the health and position tags, and save it?

Changing the player dat file would only affect it if you do it before the player logs in.

If you do it after, your saved data will be overwritten on player log out and won't come into effect at all.

 

Make an external program for the client to run before he starts his game.

 

 

Why do you want to change that data ?

  • Author

It would be happening while the player is not logged in.

I am making a mod that adds an item to bring back a dead player on a Hardcore server.

I already managed to make it unban them, but am having trouble with restoring them to life.

That seems "illegal" to me... The fact that you are trying to revive someone on a PURPOSELY made hardcore server... That just goes against the purpose of the server. So I would suggest leaving that alone... And besides, the server would have to install the mod for it to actually work anyway, and if they are wanting to be a hardcore server, then they won't install your mod. Go figure.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

I am no fool, I know that both client and server would require this mod.

Does it not occur to you that maybe I am the one setting up the server?

 

This Item is difficult to make.

Having Hardcore this way does give some permanence to death, but allows your friends a way to bring you back.

 

This is for a cooperative hardcore server, not a competitive one.

no mew its fine because server side knows whos dead and whos alive,  a random player cant revive himself with this mod

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

-hydroflame, author of the forge revolution-

no mew its fine because server side knows whos dead and whos alive,  a random player cant revive himself with this mod

 

Okay. Thanks for clearing that up :D

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

So now that we've established that I'm not doing anything evil, is there any chance of me actually getting help?

Examine their player.dat file, open it in java using a buffered reader and then write it back using a buffered writer with the modified exception.

 

NOTE: I've never needed to look into the player.dat files so I don't know what you'd be looking for sorry.

 

EDIT: Just looked into NBT and dat files, firstly the dat file is a GZIP file, with sub files, you'll have to unpack it to read and edit it.

 

This is the actual data file stored withing the {playername}.dat

HypnYaK.png <-- wouldn't let me c&p the text. you should see the variables of the palyer, this one has a few of the ones I've added too.. you can see the health section? that's what you have to edit somehow :P enjoy :)

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.