Overview
TheProject class represents a complete Minecraft add-on or world project. It manages project items (files), packs, metadata, and provides methods for building, validating, and deploying projects.
Constructor
Creates a new Project instance.Parent CreatorTools instance
Project name
File for storing project preferences
Whether to sanitize the project name
Properties
name
The project’s name
title
Display title for the project (defaults to name if not set)
description
Project description
creator
Creator/author name
shortName
Short identifier for the project
effectiveShortName
Computed short name from creator and project name
focus
Project focus type (general, world, gameplay, etc.)
items
Array of all files and folders in the project
packs
Array of behavior and resource packs
projectFolder
Root folder containing project files
defaultBehaviorPackFolder
Default behavior pack folder
defaultResourcePackFolder
Default resource pack folder
preferredScriptLanguage
Preferred language for scripts (TypeScript or JavaScript)
defaultNamespace
Default namespace for project identifiers
effectiveDefaultNamespace
Computed default namespace (uses shortName if not set)
versionMajor
Major version number
versionMinor
Minor version number
versionPatch
Patch version number
versionAsString
Version as a formatted string (e.g., “1.0.0”)
defaultBehaviorPackUniqueId
UUID for the default behavior pack
defaultResourcePackUniqueId
UUID for the default resource pack
editPreference
Edit preference for this project (raw, summarized, or editors)
showHiddenItems
Whether to show hidden files
Methods
ensureProjectFolder
Ensures the project folder exists and is loaded.The project’s root folder
ensureInflated
Ensures all project data structures are loaded and ready.inferProjectItemsFromFiles
Scans the project folder and creates ProjectItems for all files.Force re-scan even if already scanned
Callback for progress updates
save
Saves the project preferences and metadata.getItemsByType
Gets all project items of a specific type.The type of items to retrieve
Array of matching items
getItemByProjectPath
Finds a project item by its path.Path relative to project root
The matching item, or undefined if not found
ensureItemByProjectPath
Gets or creates a project item at the specified path.Path relative to project root
Storage type (singleFile or folder)
Item name
Type of item
The found or created item
removeItem
Removes a project item from the project.The item to remove
ensureDefaultBehaviorPackFolder
Ensures a default behavior pack folder exists.The behavior pack folder
ensureDefaultResourcePackFolder
Ensures a default resource pack folder exists.The resource pack folder
ensureBehaviorPackScriptsFolder
Ensures a scripts folder exists in the behavior pack.The scripts folder
updateContentsModified
Updates the last modified timestamp for the project.hasScript
Checks if the project contains any script files.True if scripts are present
getBehaviorPackCount
Gets the number of behavior packs in the project.Number of behavior packs
getResourcePackCount
Gets the number of resource packs in the project.Number of resource packs
ensureInfoSetGenerated
Generates project information and validation data.The generated info set
applyUpdate
Applies a project update/migration.The update to apply
Result of the update
Events
onPropertyChanged
Fired when a project property changes.onLoaded
Fired when the project finishes loading.onSaved
Fired when the project is saved.onItemAdded
Fired when a new item is added to the project.onItemRemoved
Fired when an item is removed from the project.onItemChanged
Fired when a project item changes.Types
ProjectFocus
ProjectScriptLanguage
ProjectEditPreference
See Also
- CreatorTools - Main application class
- ProjectItem - Individual file management
- Utilities - Helper functions