# Minecraft Command Storage

> Minecraft Command Storage 命令存储：Storage Format 存储格式（data/<namespace>/command_storage.dat GZip 压缩 NBT、Root tag data.contents 命名空间ID复合标签、DataVersion 数据版本）、Storage Behavior 存储行为（命令和数据包直接保存数据到命名空间ID、无需物品/方块实体/实体）、Writing 写入（/execute ... store storage 目标、/data merge|modify|remove storage <target>）、Reading 读取（text components nbt+storage、/execute (if|unless) data storage、/function ... with storage、/data get storage <target>、item modifiers copy_custom_data storage、number providers storage）、Storage Data Deletion 存储数据删除（{} 删除数据）、File Creation 文件创建（命令写入时创建、按需加载 内存中保留）。

- Skill: `zmjjkk123-hub/minecraft-command-storage` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zmjjkk123-hub/minecraft-command-storage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zmjjkk123-hub/minecraft-command-storage/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ZMJJKK123-hub (https://skillmd.com/u/zmjjkk123-hub)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/zmjjkk123-hub/minecraft-command-storage

---


# Command Storage Format

This content applies only to Java Edition.

Command storage files store the data of command storage.

## Storage format

Files are located at `<save root>/data/<namespace>/command_storage.dat`, in GZip-compressed NBT format:

- Root tag
  - `data` (compound, required): command storage data.
    - `contents` (compound, required): the storage contents; `<name>` (compound) per namespace ID.
  - `DataVersion` (int, required): game data version; absent = 1343 (Java 1.12.2).

## Storage behavior

Command storage lets commands and datapacks save data under namespace IDs directly, without items, block entities, or entities.

Writing:

- `/execute ... store` with target `storage`
- `/data merge|modify|remove` with source `storage <target>`

Reading:

- Text components with type `nbt` and `storage` specified
- `/execute (if|unless) data` with source `storage`
- `/function ... with` with source `storage`
- `/data get` with source `storage <target>`
- Item modifiers of type `copy_custom_data` with `storage` source
- Number providers of type `storage`

Setting storage data to `{}` deletes it. The file is created only when a command writes to storage; files load on demand and stay in memory.

