Performance & lag · Java · Intermediate

How to Clean Up Thousands of Unused idcounts, map_X.dat, and raids.dat Files

Over years of gameplay, a Minecraft Java Edition world's data folder can accumulate thousands of orphaned map files and stuck raid trackers that noticeably slow down world saving and bloat backup sizes. Every time a player opens a shipwreck chest or talks to a cartographer, the game generates new map_X.dat files that stay on the disk even if the map item is thrown into lava. This guide shows you how to safely audit and purge unused map files, reset stuck raids.dat entries, and adjust idcounts.dat using our browser-based NBT Editor.

Open the NBT EditorOpen and edit any NBT file: level.dat, player data, structures, schematics, Bedrock files.

What you need

  • A Minecraft Java Edition world folder or .zip backup
  • Access to the NBT Editor on this site (runs locally in your browser; your files are never uploaded)
  • A list of currently used Map IDs (obtained in-game via advanced tooltips)

Step by step

  1. 1Back Up Your World and Note Active Map IDs

    Before modifying any internal files, shut down your Minecraft client or server completely and duplicate your entire world folder as a safety backup. Next, log into your world briefly and press F3 + H on your keyboard to enable Advanced Tooltips. Hover over every filled map you care about (in chests, item frames, and player inventories) and write down the ID number shown as '#X' (for example, #142).

    Tip: Pay special attention to pixel art map walls and explored base maps; treasure maps from loot chests rarely need to be saved once found.

  2. 2Audit Map Files in the NBT Editor

    Open the NBT Editor on our site and click 'Open world folder or .zip' to load your world locally into your browser. Navigate into the 'data' subfolder, where you will see idcounts.dat, raids.dat, and potentially thousands of map_X.dat files. If you are unsure whether a specific map_X.dat file is an unwanted ocean explorer map or important player pixel art, click on it to expand its root 'data' compound tag. Look for the 'banners' list tag or specific map markers, as buried treasure and woodland mansion maps contain built-in target decorations that normal player-crafted maps lack.

    Tip: You can also check the 'dimension' tag inside a map_X.dat file to immediately identify and separate End or Nether maps from Overworld maps.

  3. 3Delete Orphaned map_X.dat Files

    Open your computer's file manager to your world's 'data' folder alongside the browser tool. Select and delete all map_X.dat files whose numbers do not match the safe list of active Map IDs you wrote down in Step 1. Why this works: Minecraft only loads a map_X.dat file when an item with that specific map ID is rendered in-game; if the physical item was destroyed or despawned, the file sits on your drive forever as dead weight.

  4. 4Adjust or Reset idcounts.dat

    In our NBT Editor, click on 'data/idcounts.dat' and expand the 'data' compound tag to find the 'map' integer tag. This tag stores the highest map ID created so far and tells the game which number to assign to the next newly crafted map. If you deleted all maps above a certain number (for example, keeping maps 0 through 50 and deleting 51 through 4000), double-click the 'map' tag and change its value to your highest remaining map ID (such as 50). If you deleted every single map in the world, change the 'map' value to -1 or delete idcounts.dat entirely so the counter starts fresh at 0.

    Tip: Never set the 'map' integer lower than an existing map_X.dat file you kept, or newly crafted maps will overwrite your old map artwork.

  5. 5Clean Up Stuck Raid Trackers in raids.dat

    While still in the NBT Editor inside the 'data' folder, click on 'raids.dat' (and examine 'raids_end.dat' or 'raids_nether.dat' if present). Expand the root 'data' compound tag and inspect the 'Raids' list tag. Sometimes raiders get trapped in unrendered caves or despawn improperly, leaving entries in this list that tick endlessly in the background and cause server lag. Either delete individual stuck compound entries inside the 'Raids' list using the editor, or delete the raids.dat file from your computer's 'data' folder completely when no active raid is happening to force Minecraft to generate a clean, empty file on next boot.

    Tip: If you manual-clear the 'Raids' list inside the NBT Editor, remember to set 'NextAvailableID' back to 1 and 'Tick' to 0 for a totally clean slate.

  6. 6Save Changes and Test in Minecraft

    If you edited idcounts.dat or raids.dat inside our NBT Editor, click the save or export button to download the modified files and replace the originals inside your world's 'data' folder. Launch Minecraft, open your world, and verify that your existing item frame map walls still display their images properly. Finally, craft and activate one brand-new Empty Map to confirm it takes the next expected ID number without overwriting anything.

How it works

In Minecraft Java Edition, the physical Filled Map item in your inventory does not actually store the image of the terrain. Instead, the item's NBT data holds a single integer reference tag (historically inside the tag compound, or as the 'minecraft:map_id' component in versions 1.20.5 and newer). That integer corresponds directly to a matching 'data/map_X.dat' file on the disk, which holds a 16,384-byte array representing the 128x128 pixel color grid.

Whenever a loot chest containing a buried treasure map generates—or even when a Cartographer Villager merely unlocks a trade for an Explorer Map—Minecraft reads 'data/idcounts.dat', increments the 'map' integer by one, and writes a brand-new 'map_X.dat' file. Because the game engine has no garbage-collection system to scan every unloaded chest, donkey inventory, and offline player file across all dimensions, it never deletes a map_X.dat file, even when the corresponding item is burned in lava or despawns.

Similarly, 'raids.dat' tracks active village raids per dimension inside a list tag called 'Raids'. Each entry stores villager center coordinates, wave numbers, and active entity UUIDs. On long-running worlds, chunk unloading quirks can leave ghost raid entries lingering inside 'raids.dat', adding unnecessary overhead to the world's data folder until manually cleared.

Common mistakes

  • Setting the 'map' integer inside idcounts.dat to 0 while keeping higher-numbered map files (like map_25.dat) in the folder; once the counter counts back up to 25, a newly crafted map will permanently overwrite your existing map_25.dat artwork.
  • Forgetting to check offline players' inventories or Ender Chests for valuable maps before deleting map_X.dat files, resulting in blank maps when those players log back in.
  • Editing or deleting files in the 'data' folder while the world is currently open in singleplayer or running on a multiplayer server, which causes Minecraft to overwrite your cleanup from memory when it autosaves.
  • Deleting other critical files inside the 'data' folder by accident, such as 'scoreboard.dat' or 'chunks.dat', which will wipe out your world's scoreboard objectives, teams, and force-loaded chunks.

FAQ

What happens if an item in a chest still points to a map_X.dat file that I deleted?

The game will not crash. If a player picks up or looks at a map item whose corresponding map_X.dat file was deleted, the map will simply appear completely blank and will not fill in any new terrain.

Why do I have thousands of map files when I have only crafted ten maps?

Every time you pass near a shipwreck, ocean ruin, or village cartographer, Minecraft generates the loot tables and villager trades in the background. Each treasure or explorer map created during chunk generation claims a new ID and writes a permanent map_X.dat file, even if you never opened the chest or traded with the villager.

Are my world files uploaded to a server when I use the NBT Editor on this site?

No. All tools on world.9minecraft.net run directly inside your web browser using local JavaScript. Your world folder and .dat files never leave your computer.

By auditing your world's data folder with our browser-based NBT Editor, removing unreferenced map_X.dat files, resetting idcounts.dat, and clearing stuck entries in raids.dat, you can dramatically shrink your backup file count and keep your Minecraft Java world running cleanly.

More performance & lag guides

Performance & lagHow to Find and Remove Forgotten Force-Loaded Chunks in chunks.datForce-loaded chunks stay active in memory even when no players are nearby, which is useful for farms and command setups. However, uninstalled datapacks or forgotten `/forceload` commands often leave hidden chunk tickets behind, causing severe server tick lag and unnecessary memory usage. This guide explains how to locate and remove these forgotten tickets inside your `chunks.dat` files using the browser-based NBT Editor.JavaIntermediate5 steps
Performance & lagHow to Find Hidden Mob Build-Ups and Entity Hotspots in Your World SaveUnexplained severe lag in a Minecraft Java Edition world is often caused by hundreds of entities crammed into a single area, such as an unmonitored chicken farm or a dark cave where zombies keep picking up dropped items. Since Minecraft stores entity data separately from terrain blocks, you can pinpoint these lag hotspots by inspecting the size and contents of your world's entity files. This guide walks you through using our browser-based NBT Editor to locate and clean up runaway mob build-ups safely without ever uploading your save files.JavaIntermediate6 steps
Performance & lagHow to Locate Chunks With Excessive Hoppers, Chests, and Signs via Chunk NBTMassive storage systems filled with hundreds of hoppers, chests, and signs can easily cripple server TPS and tank client FPS when players wander nearby. By auditing the block_entities lists directly inside your region files, you can pinpoint the exact chunk coordinates of hidden lag machines or overgrown storage silos without ever loading the world in-game. This guide uses our browser-based NBT Editor to safely inspect and prune problematic chunk data entirely on your local device.JavaAdvanced5 steps