Modifying the Resource Pack Template
Relevant source files
The following files were used as context for generating this wiki page:
The HoloPrint resource pack generation system relies on a base template located within the src/packTemplate/ directory. This template provides the skeletal structure for Minecraft Bedrock Edition (MCBE) resource packs, which the makePack function then populates with dynamic data extracted from .mcstructure files.
The modification process involves injecting unique identifiers (UUIDs), configuring subpacks for different activation modes, dynamically generating geometry and animation controllers, and localizing strings via .lang files. This ensures that every generated pack is a standalone, functional tool tailored to the user's specific schematic and configuration settings.
Core Template Architecture
The template is composed of several JSON-based configuration files that define how the hologram behaves in-game. The primary logic for modifying these files resides in src/HoloPrint.js, which uses the loadPackTemplate function to retrieve the base files before applying transformations.
The diagram shows the data flow from the static template files and user inputs into the final assembled resource pack.
Sources: src/HoloPrint.js:46-150, src/HoloPrint.js:433-470
Manifest and Metadata Configuration
The manifest.json file serves as the identity of the resource pack. During generation, the system performs the following modifications:
- UUID Generation: New random UUIDs are generated for both the header and the modules to prevent pack ID collisions in Minecraft.
- Version Management: The
min_engine_versionis maintained (defaulting to 1.16.0), while the pack version is typically derived from the HoloPrint app version. - Subpacks: The template includes a
subpackssection allowing users to choose between "Default" (initial activation) and "Punch to activate" modes. - Metadata: Authors, descriptions, and dynamic links are injected based on the
HoloPrintConfigobject.
| Field | Template Source | Dynamic Replacement Logic |
|---|---|---|
header.name | "pack.name" | User-provided config.PACK_NAME or file name. |
header.uuid | Placeholder | crypto.randomUUID() |
modules[0].uuid | Placeholder | crypto.randomUUID() |
metadata.authors | ["HoloPrint"] | Appends config.AUTHORS array. |
Sources: src/packTemplate/manifest.json:1-42, src/HoloPrint.js:380-405
Entity and Geometry Modification
HoloPrint modifies the standard Armor Stand entity to render the hologram geometry. The process involves mapping block data from the structure into a poly_mesh format within the geometry file.
Armor Stand Entity
The template entity/armor_stand.entity.json is modified to include:
- Materials: Adding
holoprint_hologramandholoprint_hologram.wrong_block_overlay. - Animations: Injecting custom controllers for alignment, layers, bounding boxes, and block validation.
- Scripts: Initializing Molang variables that track state such as the current structure index, layer mode, and transparency level.
Dynamic Geometry Generation
The geometry is not static; HoloPrint.js clones a structure geometry template for each structure in the pack. It sets the texture_width and texture_height based on the generated TextureAtlas.
This sequence illustrates how the geometry is dynamically constructed per structure.
Sources: src/HoloPrint.js:195-260, src/HoloPrint.js:330-360
Animation and Controller Systems
The template includes logic for complex in-game behaviors managed through animation controllers.
Layer and Spawn Animations
- Layer Transitions:
makeLayerAnimationsgenerates Molang-based transitions that toggle visibility of bones based on thev.hologram.layervariable. - Spawn Animation: If enabled, the
SpawnAnimationMakerconstructs a sequence where blocks appear to scale or move into place when the armor stand is initialized.
Block Validation
Block validation is handled by generating unique particle effects for each block type in the structure. The HoloPrint.js logic creates a specific particle file for every unique block found, referencing the particles/block_validation.json template.
Sources: src/HoloPrint.js:296-320, src/HoloPrint.js:364-375, src/HoloPrint.js:440-447
Localization and Strings
The template utilizes .lang files for user-facing text. The system maps translation keys from src/translations/en_US.json and other language files into the resource pack's texts/ folder.
Key features of localization modification:
- Variable Substitution: Placeholders like
{PACK_NAME},{TOTAL_MATERIAL_COUNT}, and{DESCRIPTION}are replaced with actual data. - Control Item Naming: If
RENAME_CONTROL_ITEMSis enabled, the system appends the control's function (e.g., "Toggle Rendering") to the item's hover text in-game. - Feature Status: The pack description is dynamically updated to list which features (like Spawn Animation or UI Controls) are enabled or disabled.
Sources: src/HoloPrint.js:415-430, src/HoloPrint.js:775-817, src/translations/en_US.json:20-50
Summary of Template Modifications
The HoloPrint engine effectively transforms a generic MCBE template into a specialized tool. By manipulating JSON structures and Molang scripts programmatically, the project avoids the need for manual resource pack creation, allowing for features like dynamic material lists and coordinate-locked holograms to be embedded directly into the generated .mcpack files.