Core Concepts
The storage system is built around three main interfaces:- IStorage - Represents a storage system with a root folder
- IFolder - Represents a directory/folder in the storage system
- IFile - Represents a file in the storage system
Storage Implementations
Minecraft Creator Tools provides several storage implementations:| Implementation | Environment | Use Case |
|---|---|---|
| NodeStorage | Node.js | Local file system access in desktop/CLI |
| BrowserStorage | Browser | Client-side persistent storage using IndexedDB |
| HttpStorage | Browser/Node | Read-only access to HTTP resources |
| GitHubStorage | Browser/Node | Read-only access to GitHub repositories |
| ZipStorage | Both | Working with .mcpack, .mcaddon, .zip files |
| Storage | Both | In-memory storage for temporary data |
Async Loading Pattern
Files and folders use an async loading pattern. Content is not loaded until explicitly requested:- Efficient memory usage (only load what you need)
- Better performance for large projects
- Progressive loading of directory structures
Change Tracking
Storage systems track changes and provide events for monitoring updates:Version History
The storage system maintains version history for files, enabling undo/redo functionality:Error Handling
Storage operations may fail. Check for error status:Common Patterns
Working with JSON Files
Iterating Through All Files
Syncing Folders
Next Steps
- File System Interfaces - Detailed API reference for IFile, IFolder, and IStorage
- Storage Implementations - Learn about specific storage types