@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
32 lines (31 loc) • 1.37 kB
TypeScript
/**
* RenameCommand - Rename content in a Minecraft project
*
* Renames a project item, updating the identifier inside its JSON
* and cascading the rename to related files:
* - Entity behavior → resource entity, spawn rules
* - Entity resource → (file + identifier only)
*/
import type { IToolCommandMetadata, IToolCommandResult } from "../IToolCommand";
import { ToolCommandBase } from "../IToolCommand";
import type { IToolCommandContext } from "../IToolCommandContext";
export declare class RenameCommand extends ToolCommandBase {
readonly metadata: IToolCommandMetadata;
execute(context: IToolCommandContext, args: string[], _flags: Record<string, string | boolean | string[]>): Promise<IToolCommandResult>;
/**
* Builds a new entity identifier by replacing the short name portion.
* E.g., "myns:old_mob" + "new_mob" → "myns:new_mob"
*/
private _buildNewEntityId;
/**
* Cascades a rename from an entity behavior item to its resource entity
* and spawn rules. Updates identifiers in JSON and renames related files.
*/
private _cascadeEntityBehaviorRename;
/**
* Updates the identifier inside an entity resource definition when
* the resource item itself is being renamed directly.
*/
private _cascadeEntityResourceRename;
}
export declare const renameCommand: RenameCommand;