{{lowercase title}}
{{about|the directory used by Bedrock Edition|the directory used by ''Java Edition''|.minecraft}}
{{distinguish|Mojang.com}}
{{exclusive|bedrock|education}}

{{File|directory|'''com.mojang'''|inline=1}} is a directory used internally by ''Minecraft'' Bedrock Edition. It contains worlds, [[JSON]] data, and other files necessary for the game to run.

== Location ==
{{/path}}

=== Android quirks ===

On Android, there are two distinct {{File|directory|'''com.mojang'''|inline=1}} directories - internal and external. If the ''File Storage Location'' option is set to ''Application'', all data is stored in the internal directory. If it's set to ''External'', some data (such as worlds) is stored in the external directory, but the internal directory is still used for other data.

The external directory can be viewed and edited by users, though it might require workarounds in newer Android versions. The internal directory cannot be viewed or edited without root access. It's not possible to migrate worlds and other data between those directories without root access.

The user ID is usually <code>0</code>, but differs if the user is a secondary user. <code>/storage/emulated/''user ID''</code> is often presented as ''Internal storage'' or similar by file managers, or when you access the device via MTP (connected to a Linux, macOS or Windows computer).

== Directory structure ==
<div class="treeview">
* {{File|directory|com.mojang}}
** {{File|directory|behavior_packs}}: Contains [[behavior pack]]s, see {{slink||Behavior packs}}.
** {{File|directory|development_behavior_packs}}{{info needed|What is in this directory?}}
** {{File|directory|development_resource_packs}}{{info needed|What is in this directory?}}
** {{File|directory|development_skin_packs}}{{info needed|What is in this directory?}}
** {{File|directory|logs}}
*** {{File|file|ClientCorrelation<ID>.dat}}{{info needed}}
** {{File|directory|minecraftpe}}
*** {{File|file|catalog_info.json}}
*** {{File|file|clientId.txt}}
*** {{File|file|custom.png}}
*** {{File|file|global_resource_packs.json}}
*** {{File|directory|hs}}{{note|This file has no extension. It is a plaintext list of UUIDs, separated by newlines.{{info needed|What are the UUIDs for? I've heard people say this is for rolling out the new Bedrock UI, but I can not confirm nor deny that.}}}}
*** {{File|file|[[options.txt]]}}
*** {{File|file|telemetry_info.json}}
*** {{File|file|valid_known_packs.json}}
** {{File|directory|minecraftWorlds}}: Contains [[world]]s.
*** {{File|directory|''internal world ID''}}
**** {{File|directory|behavior_packs}}: Contains world behavior packs, see {{slink||Behavior packs}}.
**** {{File|directory|db}}
***** {{File|file|''region ID''.dat}}<ref group="note">The region ID is a 6-digit number. The region containing the player{{verify}} is a .log instead of a .dat.</ref>
***** {{File|file|CURRENT.dat}}
***** {{File|file|LOCK.dat}}{{info needed|Not all worlds have this. Does is depend on the version in which the world was created?}}
***** {{File|file|MANIFEST-<ID>.dat}}
**** {{File|file|[[Bedrock Edition level format#level.dat|level.dat]]}}
**** {{File|file|level.dat_old}}
**** {{File|file|levelname.txt}}
**** {{File|directory|resource_packs}}: Contains world [[resource pack]]s, see {{slink||Resource packs}}.
**** {{File|file|world_behavior_packs.json}}
**** {{File|file|world_icon.jpeg}}
**** {{File|file|world_resource_packs.json}}
** {{File|directory|resource_packs}}: Contains [[resource pack]]s, see {{slink||Resource packs}}.
** {{File|directory|skin_packs}}
*** {{File|file|''skin pack name''}}{{info needed|How are skin packs structured?}}
** {{File|directory|Screenshots}}{{sic}}: Contains [[screenshot]]s, see [[Screenshot#Bedrock Edition]].
*** {{File|directory|''XUID''}}: Contains screenshots made on a specific Xbox account. The XUID is the ID of the player's Xbox account.
**** {{File|file|''YYYY''-''MM''-''DD''_''HH''.''mm''.''ss''[''sequence''].jpeg}}: Screenshot in JPEG format.
**** {{File|file|''YYYY''-''MM''-''DD''_''HH''.''mm''.''ss''[''sequence''].mc}}: Additional file of unknown format{{info needed}}. One for each screenshot, has the same name as the screenshot, but with <code>.mc</code> suffix instead of <code>.jpeg</code>.
** {{File|file|ud''id''.dat}} (there may be more than one)
** {{File|directory|world_templates}}{{info needed|What is in this directory?}}
** {{File|file|xal}}{{verify|Exists in PE 1.16.0+?}}{{info needed|Is it the account data for XBL?}}{{verify|Is this a regular file and not a directory?}}
</div>

Each world and the {{File|directory|com.mojang|inline=1}} directory itself has a {{File|directory|resource_packs|inline=1}} and a {{File|directory|behavior_packs|inline=1}} directory.

=== Resource packs ===
[[Resource pack]]s have the following directory structure:

<div class="treeview">
* {{File|directory|''resource pack name''}}{{info needed|Is this a complete list?}}
** {{File|file|manifest.json}}
** {{File|file|pack_icon.png}}
** {{File|directory|shaders}}
*** {{File|directory|glsl}}
**** {{File|file|renderchunk.dat}}
*** {{File|directory|hlsl}}
**** {{File|file|renderchunk.fragment.dat}}
** {{File|directory|text}}
*** {{File|file|''language''.lang}}
*** {{File|file|languages.json}}
</div>

=== Behavior packs ===
[[Behavior packs]]s can contain anything that a resource pack contains, plus additional files.{{verify}}

<div class="treeview">
* {{File|directory|''behavior pack name''}}{{info needed}}
** Resource pack files, see {{slink||Resource packs}}.
** {{File|directory|loot_tables}}
*** {{File|directory|blocks}}{{verify}}
**** {{File|file|''block name''.json}}
*** {{File|directory|entities}}
**** {{File|file|''entity name''.json}}
** {{File|directory|recipes}}
*** {{File|file|''item name''.json}}
</div>

== History ==
{{HistoryTable
|{{HistoryLine|pocket alpha}}
|{{HistoryLine||v0.1.0|Added the {{File|directory|com.mojang|inline=1}} directory at the path <code>/storage/emulated/<user ID>/games/com.mojang</code>.
|The file hierarchy of com.mojang is as follows:
<div class{{=}}"treeview">
* {{File|directory|com.mojang}}
** {{File|directory|minecraftWorlds}}
*** {{File|directory|''world name''}}
**** {{File|file|chunks.dat}}: Stores [[chunk]] data.
**** {{File|file|[[Bedrock Edition level format#level.dat|level.dat]]}}: Stores information about the world.
**** {{File|file|[[Bedrock Edition level format/v0.1.0 alpha#player.dat|player.dat]]}}: Stores [[player]] data.
</div>
}}
|{{HistoryLine||v0.2.0|Added {{File|file|entities.dat|inline=1}} under {{File|directory|''world name''|inline=1}}, which stores [[entity]] data.
|{{File|file|player.dat|inline=1}} is no longer created nor used by the game and the data previously in there has been moved to {{File|file|level.dat|inline=1}}. Existing {{File|file|player.dat|inline=1}} files still remain.}}
|{{HistoryLine||v0.3.3|This version creates unused duplicate directories under <code>com.mojang/../games/com.mojang/minecraftWorlds</code>. {{File|directory|minecraftWorlds|inline=1}} does not have any additional files.}}
|{{HistoryLine||v0.5.0|Added {{File|file|level.dat_old|inline=1}} under {{File|directory|''world name''|inline=1}}, which is a backup of {{File|file|level.dat|inline=1}}.}}
|{{HistoryLine||v0.7.0|Added the {{File|directory|minecraftpe|inline=1}} directory under {{File|directory|com.mojang|inline=1}}.
|{{File|directory|minecraftpe|inline=1}} contains two files: {{File|file|clientId.txt|inline=1}} and {{File|file|[[options.txt]]|inline=1}}.
|Added the {{File|directory|players|inline=1}} directory under {{File|directory|''world name''|inline=1}}.}}
|{{HistoryLine||v0.7.3|Added the {{File|directory|_LevelCache|inline=1}} directory under {{File|directory|minecraftWorlds|inline=1}}, whose usage is not currently known.}}
|{{HistoryLine||v0.9.0|dev=build 1|
{{Collapse|title=Due to the switch to the [[Bedrock Edition level format/History#LevelDB based format|LevelDB level format]], the file hierarchy of com.mojang is now as follows, with temporary files from worlds using the previous level format being <span class="history-deleted">struck through</span>:|content=
<div class="treeview">
* {{File|directory|com.mojang}}
** {{File|directory|minecraftpe}}
*** {{File|file|clientId.txt}}
*** {{File|file|options.txt}}
** {{File|directory|minecraftWorlds}}
*** {{File|directory|_LevelCache}}
*** {{File|directory|''world name''}}
**** {{File|directory|db}}
***** {{File|file|######.ldb}}
***** {{File|file|######.log}}
***** {{File|file|CURRENT}}: The content of this file is <code>MANIFEST-######</code>.
***** {{File|file|LOCK}}: An empty file.
***** {{File|file|MANIFEST-######}}
**** {{File|file|<span class{{=}}"history-deleted">chunks.dat</span>}}
**** {{File|file|<span class{{=}}"history-deleted">entities.dat</span>}}
**** {{File|file|<span class{{=}}"history-deleted">importedchunks.dat</span>}}: Lets the game know which chunks have been converted to the new level format.
**** {{File|file|level.dat}}
</div>}}
|{{File|file|level.dat_old|inline=1}} files are no longer created nor updated by the game, but any existing ones are still functional.}}
|{{HistoryLine|||dev=build 4|Added {{File|file|LOG|inline=1}} and {{File|file|LOG.old|inline=1}} files under {{File|directory|db|inline=1}}.}}
|{{HistoryLine|||dev=build 8|Removed the {{File|directory|_LevelCache|inline=1}} directory.}}
|{{HistoryLine||v0.11.0|dev=build 1|Added the {{File|directory|snooper|inline=1}} directory under {{File|directory|minecraftpe|inline=1}}.
|{{File|file|snooper|inline=1}} contains at least one file named {{File|file|bundle#.txt|inline=1}}, and a file named {{File|file|meta.txt|inline=1}}.
|For newly-created worlds, the directory name is now {{File|directory|''internal world ID''|inline=1}} instead of {{File|directory|''world name''|inline=1}}.
|Added {{File|file|levelname.txt|inline=1}} under {{File|directory|''internal world ID''|inline=1}}.
|<code>level.dat_old</code> is now created if the player goes to a given world's edit menu and changes any settings in it. Doing this also deletes the world's <code>level.dat</code> file, though it is created again upon world reentry.}}
|{{HistoryLine||v0.13.0|dev=build 1|The <code>snooper</code> directory has been moved from <code>com.mojang/minecraftpe/snooper</code> to <code>com.mojang/snooper</code>. The old <code>snooper</code> directory still remains, but is no longer updated.}}
|{{HistoryLine||v0.14.2|<code>snooper</code> is no longer created nor updated by the game.}}
|{{HistoryLine||v0.15.0|dev=build 1|Added <code>r.txt</code> file under <code>minecraftpe</code>. The content of this file is <code>Vanilla</code>.
|<code>LOG</code> and <code>LOG.old</code> files are no longer generated by the game.}}
|{{HistoryLine|||dev=build 2|Added <code>r2.txt</code> file under <code>minecraftpe</code>. The content of this file is <code>Minecraft</code>.
|<code>r.txt</code> is no longer created by the game.
|<code>level.dat_old</code> is once again created by the game whenever the player exits a world.}}
|{{HistoryLine|||dev=release|Added <code>resource_packs.txt</code> file under <code>minecraftpe</code>. The content of this file is <code>Minecraft</code>.
|<code>r2.txt</code> is no longer created by the game.}}
|{{HistoryLine||v0.16.0|dev=build 1|<code>resource_packs.txt</code> is now an empty file by default.
|<code>resource_packs.txt</code> files are now created for each individual world under <code><internal world ID></code>.}}
|{{HistoryLine|||dev=build 4|Added <code>global_resource_packs.txt</code> file under <code>minecraftpe</code>. This file is empty by default.}}
|{{HistoryLine|||dev=build 5|Added two directories under <code>com.mojang</code>: <code>behavior_packs</code> and <code>resource_packs</code>. Both are empty by default.
|Added <code>Perf_Log.csv</code> file under <code>com.mojang</code>.
|Replaced <code>global_resource_packs.txt</code> with <code>global_resource_packs.json</code>.
|Added two directories under <code><internal world ID></code>: <code>behavior_packs</code> and <code>resource_packs</code>. Both are empty by default.
|Added two files under <code><internal world ID></code>: <code>world_behavior_packs.json</code> and <code>world_resource_packs.json</code>.
|<code>resource_packs.txt</code> files are no longer generated by the game.
|
{{Collapse|title=The file hierarchy of <code>com.mojang</code> is now as follows:|content=
<div class="treeview">
* {{File|directory|com.mojang}}
** {{File|directory|behavior_packs}}
** {{File|directory|minecraftpe}}
*** {{File|file|clientId.txt}}
*** {{File|file|global_resource_packs.json}}
*** {{File|file|options.txt}}
** {{File|directory|minecraftWorlds}}
*** {{File|directory|<internal world ID>}}
**** {{File|directory|behavior_packs}}
**** {{File|directory|db}}
***** {{File|file|######.ldb}}
***** {{File|file|######.log}}
***** {{File|file|CURRENT}}
***** {{File|file|LOCK}}
***** {{File|file|MANIFEST-######}}
**** {{File|directory|resource_packs}}
**** {{File|file|<span class{{=}}"history-deleted">chunks.dat</span>}}
**** {{File|file|<span class{{=}}"history-deleted">entities.dat</span>}}
**** {{File|file|<span class{{=}}"history-deleted">importedchunks.dat</span>}}
**** {{File|file|level.dat}}
**** {{File|file|levelname.txt}}
**** {{File|file|world_behavior_packs.json}}
**** {{File|file|world_resource_packs.json}}
** {{File|directory|resource_packs}}
** {{File|file|Perf_Log.csv}}
</div>}}
}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.18.0|dev=beta 1.18.0.21|Changed the path of the {{File|directory|com.mojang|inline=1}} directory on Android due to API changes.
|New path: <code>/data/user/<user ID>/com.mojang.minecraftpe/games/com.mojang</code> (internal) and <code>/storage/emulated/<user ID>/Android/data/com.mojang.minecraftpe/files/games/com.mojang</code> (external).}}
|{{HistoryLine||1.20.0|dev=Preview 1.20.0.22|The files {{File|file|.nomedia|inline=1}} and {{File|file|ud''id''.dat|inline=1}}, and directories {{File|directory|logs|inline=1}}, {{File|directory|minecraftpe|inline=1}} and {{File|directory|xal|inline=1}} in the external {{File|directory|com.mojang|inline=1}} directory on Android are no longer used.<ref name="mcpe">{{bug|MCPE-176675||Settings lost because some files and folders are no longer generated within external storage}}</ref>}}
|{{HistoryLine||1.20.10|dev=Preview 1.20.10.20|The directory {{File|directory|logs|inline=1}} in the external {{File|directory|com.mojang|inline=1}} directory on Android is once again used.}}
|{{HistoryLine||1.20.70|dev=Preview 1.20.70.20|The directory {{File|directory|minecraftpe|inline=1}}, and the files {{File|file|.nomedia|inline=1}} and {{File|file|ud''id''.dat|inline=1}} in the external {{File|directory|com.mojang|inline=1}} directory on Android are once again used.<ref name="mcpe"/>}}
}}

== Notes ==
{{Notelist}}

== References ==
{{Reflist}}

== Navigation ==
{{Navbox Bedrock Edition}}

[[Category:Development]]

[[es:Com.mojang]]
[[fr:Com.mojang]]
[[lzh:Com.mojang]]
[[pt:Com.mojang]]
[[zh:Com.mojang]]
