Is ther ea way to auto-kill the player upon world start?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Yuka

New Member
Jul 29, 2019
318
0
0
Got a problem that crashes my game soon after I start my world, guessing its something to do with some enchants I put on my armor to test some stuff.
I'm sure if I were to be able to quickly unequip the armor or kill the player upon world start, the problem would stop, but I don't have enough time to unequip the items or type the kill command, so I'm wondering if there's a way to kill the player before the world loads, or a way to automatically input a command as soon as the world loads.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
You could use an NBT editor to edit the player file, I like NBTExplorer. I'm not an expert on the format though, but you should be able to set the health to 1 and turn on the "On Fire" flag even if you can't work out how to zap the inventory directly. Do you have an old backup of your world that you could copy the player .dat file across from as a test? Or, just create a new world and copy the .dat file across from that. It should be in minecraft/saves/WorldName/players/YourPlayerName.dat, in the appropriate launcher directory e.g. mine is in "D:\FTB\Direwolf20\minecraft\saves\New World\players". At least that would tell you if it's anything in the player's inventory that is causing the problem.
 
  • Like
Reactions: Yuka

Yuka

New Member
Jul 29, 2019
318
0
0
Do you have an old backup of your world that you could copy the player .dat file across from as a test? Or, just create a new world and copy the .dat file across from that. It should be in minecraft/saves/WorldName/players/YourPlayerName.dat, in the appropriate launcher directory e.g. mine is in "D:\FTB\Direwolf20\minecraft\saves\New World\players". At least that would tell you if it's anything in the player's inventory that is causing the problem.

That's weird, I tried that, but my inventory stayed the same.
Hmm, I might try the NBT editor thing.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
When my world wasn't loading due to a Mystcraft issue, I copied across the .dat file from an old save and my inventory reverted to the old save version - no Gravity Gun or Advanced Chainsaw, but I did get a sweet Vile Sword back with a ton of enchants on it so I called it even.
 

Yuka

New Member
Jul 29, 2019
318
0
0
Well I've had some issues where sometimes "backup worlds" still keep getting saved along the main save, so that may have been what's going on...

Anyways, doesn't matter for now, thanks to some button config shifting and a couple of attempts, I somehow managed to unequip the armor which did in fact stopped a crash afterwards, so it was te cause after all.
But everything's alright now, so yay! :D

Thanks for the help, at least I know what to do in case I absolutely need to destroy my inventory by launch, with the kind of testing I do I'm sure that information will come i quite handy. :p
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
One thing to bear in mind is that the player's position in the old save may well be inside a solid block in the new world if you've built something new or grown some trees. It could even be right next to a fssssssssBOOM!
 

WTFFFS

New Member
Jul 29, 2019
768
0
0
Just a quick note for anyone who is using an NBTeditor of some sort to sidestep an issue, you have to edit "level.dat" not "player.dat" as the player.dat is rebuilt on load from the level.dat file.