Skip to content

Storage

Mqx edited this page Feb 20, 2025 · 1 revision

If your datapack creates storages, the following directory structure should exist:

Datapack/
├─ pack.mcmeta
└─ data/
   └─ <namespace>/
      └─ function/
         └─ storage/
            ├─ add.mcfunction
            └─ remove.mcfunction
  • <namespace>:storage/add This function should be called by the #minecraft:load.json file when the Datapack is started. All initial values for a storage are set in this file.
  • <namespace>:storage/remove This function should be called by the <namespace>:uninstall function when the datapack is removed. In this file, all storages that were previously created are removed so that no artifacts are left behind. It is also recommended to inform the user that after removing the storages the storage_<namespace>.dat inside the saves/<world> folder can be deleted, because Minecraft doesn't remove empty storage files by itself.
Clone this wiki locally