Jump to content

Modify the health and position of an offline player


Lightwave

Recommended Posts

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?

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)

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.