0

I used the /clear command, and I accidentally got rid of a very important book. Is there a way to get it back without having to rewrite it?

2
  • Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
    – Frank
    Commented Nov 16, 2017 at 0:41
  • You are simply can do it with the NBTExplorer program. First of all, you Open your save and check level.dat_old/Data/Player/Inventory if you can see Inventory items just copy this folder. Then you should paste this data to level.dat/Data/Player/Inventory and to playerdata/name.dat and to the playerdata/name.dat_old at the same way. Got it!
    – GGO
    Commented Aug 5, 2021 at 11:28

5 Answers 5

5

Without any mods, it's not possible. You'll have to rewrite the book then

If you have very specific or important items in your inventory, you should temporarily throw them on the ground or put them in a chest before using /clear.

1
  • I forgot the book was in my inventory. I should be more careful... I'm a noob
    – Urgence
    Commented Nov 18, 2017 at 19:02
9

You can try crashing/killing Minecraft as soon as possible after that happens by either holding down F3+C for 10 seconds or stopping javaw.exe in the task manager. Do not use the "X" icon or Alt+F4, since that triggers saving.

If you're really lucky, no autosave happened between your command and the exiting, that would mean that your inventory (and everything else in the world) resets to the state it was a few seconds ago.

8
  • Or flicking the power off on your computer? Both 10 secs f3+c and locating and quitting javaw seem very slow
    – minseong
    Commented Nov 16, 2017 at 2:10
  • 3
    That is funny. I had the same thought. Who knew, crash the game, could ever actually be a solution.
    – IronAnvil
    Commented Nov 16, 2017 at 3:31
  • Shutting down stuff is often a good reaction in panic situations. If I mess up a Minecraft world, I immediately exit Minecraft, turn off internet, turn my laptop on, which has no internet by default, copy the old version of the synchronised file and turn internet on on it to synchronise that. If you have a virus that either copies itself or deletes/encrypts your files, you should immediately turn your computer off and disconnect all storage mediums. If a robot, production line or other machine does something unwanted, you stop it. If a program has a really bad error, it should crash. Commented Nov 16, 2017 at 8:12
  • I wouldn't. Mine usually autosaves, so all that'll do is just waste time.
    – Urgence
    Commented Nov 18, 2017 at 19:01
  • You mean Minecraft? And yes, it autosaves, but only every few seconds, so if you immediately kill the process without giving it the chance to save (through task manager or F3+C, not the cross or the ingame button), you might be lucky. Commented Nov 19, 2017 at 11:45
4

In addition to the previous answers, I'd like to give you a preventive measure:

Make use of the saved hotbars if you have an important item you don't want to loose. You can get back your saved hotbars at any time while in creative mode. Just make sure you don't override the important one.

To access saved hotbars, use X+number (load) or C+number (save) respectively.

0

For what its worth: using a Minecraft Forge Server on 1.20.1 of the game, I found that it saves a .dat_old file in the world folder under the playerdata subfolder. Renaming the original .dat file for your user account to .dat_wiped and copying the .dat_old file to have the same name and extension as the original .dat file will for most intents and purposes revert your inventory to the previous state. At least I don't notice any differences from what I had before the wipe at this time.

0

A more technical solution:

  1. Navigate to your save backup folder, pick the nearest one, open the folder playerdata and 2 files called level.dat and level.dat_old.

  2. Delete the folder and files playerdata, level.dat and level.dat_old from your world.

  3. Copy the level.dat and level.dat_old that you just opened into your world.

Note: Some of the world history might be deleted in the process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .