In-Game Hologram Controls
Relevant source files
The following files were used as context for generating this wiki page:
In-game hologram controls allow users to interact with and manipulate 3D build projections directly within Minecraft Bedrock Edition. These controls are implemented through a combination of item-based detection, Molang scripts, and entity render controllers. By holding specific items or interacting with an armor stand, players can modify the hologram's visibility, position, rotation, and active layers.
Sources: README.md:35-37, src/HoloPrint.js:63-65
Control Architecture and Logic
The control system operates by detecting the item currently held by the player or the armor stand. When a match is found based on pre-defined ItemCriteria, the resource pack updates internal Molang variables (prefixed with v.hologram.*). These variables then drive the transformations in the entity's geometry and visibility states in the render controller.
Interaction Flow
The flow of control from item detection to visual update. Sources: src/HoloPrint.js:380-410, src/packTemplate/render_controllers/holoprint.hologram.render_controllers.json:4-15
Molang Variable Mapping
Controls primarily manipulate variables that influence the hologram_alignment_wrapper and hologram_offset_wrapper bones within the entity's geometry.
| Action | Primary Molang Variable | Triggering Mechanism |
|---|---|---|
| Visibility | v.hologram.rendering | Holding/Interacting with Toggle Item |
| Translation | v.hologram.offset | Update based on movement control |
| Rotation | v.hologram.rotation | Incremental change on interaction |
| Active Layer | v.hologram.layer | Sneak/Stand state with layer item |
Sources: src/HoloPrint.js:283-305, src/packTemplate/models/entity/holoprint.hologram.geo.json:11-16
Default Item Mappings
HoloPrint defines a set of default items used to trigger specific hologram behaviors. These can be customized during the pack generation process via the web interface.
| Control Action | Default Item | Description |
|---|---|---|
| Toggle Rendering | Brick | Switches the hologram visibility on/off. |
| Change Transparency | Amethyst Shard | Increases opacity when standing, decreases when sneaking. |
| Change Layer | Leather | Increases layer index; sneaking decreases it. |
| Move Hologram | Stick | Adjusts the XYZ position of the projection. |
| Rotate Hologram | Copper Ingot | Rotates the structure around the Y-axis. |
| Block Validation | Iron Ingot | Toggles visual feedback for correct/incorrect blocks. |
| Change Layer Mode | Flint | Toggles between "Single Layer" and "All Layers Below". |
| Save Backup | Paper | Saves the current hologram configuration state. |
| Disable Controls | Bone | Prevents further player manipulation of the hologram. |
Sources: src/HoloPrint.js:46-59, README.md:39-52, src/translations/en_US.json:34-45
Render Controller Integration
The rendering of holograms is managed by controller.render.holoprint.hologram. It utilizes arrays of textures and geometries to switch between different structures and opacity levels dynamically.
The sequence of events when a player manipulates the hologram position. Sources: src/packTemplate/render_controllers/holoprint.hologram.render_controllers.json:4-28, src/packTemplate/models/entity/holoprint.hologram.geo.json:30-35
Component Visibility
The render controller switches visibility based on the following logic:
- Main Hologram: Rendered when
v.hologram.renderingis true. - Wrong Block Overlay: Visible when
v.hologram.show_wrong_block_overlayis triggered during validation. - Valid Structure Overlay: Shown when
v.hologram.validatingis active andv.wrong_blocksis zero.
Sources: src/packTemplate/render_controllers/holoprint.hologram.render_controllers.json:34-60, src/HoloPrint.js:321-330
Implementation Details
Item Criteria Definition
Controls are defined using the ItemCriteria structure, which supports both specific item names and tags (e.g., minecraft:planks).
export function createItemCriteria(names, tags = []) {
if(!Array.isArray(names)) { names = [names]; }
if(!Array.isArray(tags)) { tags = [tags]; }
return { names, tags };
}
Sources: src/HoloPrint.js:655-663
Armor Stand Initialization
When an armor stand is used to host a hologram, it runs an initialization script to set default values, including the initial structure index and activation state.
entityDescription["scripts"]["initialize"].push(functionToMolang(entityScripts.armorStandInitialization, {
structureSize: structureSizes[0],
initialOffset: config.INITIAL_OFFSET,
defaultTextureIndex,
singleLayerMode: HOLOGRAM_LAYER_MODES.SINGLE,
structureCount: structureFiles.length
}));
Sources: src/HoloPrint.js:293-300
User Interface Configuration
The configuration for these controls is exposed to the user through the generatePackForm. Users can override default item criteria before the resource pack is generated. The ItemCriteriaInput component handles the selection of names and tags, which are then passed to the makePack function.
Sources: src/index.js:220-235, src/index.js:468-485
Conclusion
The in-game hologram control system provides a robust mechanism for manipulating structures within Minecraft Bedrock Edition. By leveraging native resource pack features like render controllers and Molang-driven animations, it enables a feature set comparable to Java Edition mods like Litematica without requiring external behavior packs or experimental features.