Prefab Renderer
Renders Hytale prefabs (*.prefab.json) as an interactive 3D view inside VS Code.
Features
- 3D view for
*.prefab.json as an optional editor: the JSON keeps opening as text. Open the view with
Hytale: Open Prefab Preview (editor title button, Explorer context menu, Command Palette) or
Reopen Editor With… → Hytale Prefab 3D View.
- Live update while you edit the JSON (also before saving) or when the file changes on disk.
- Cube blocks with per-face textures (
All, Sides/UpDown, Up/Down/North/…), hidden faces between
solid cubes are culled.
- Model blocks from
.blockymodel files (boxes and quads, node hierarchy, UV offset/mirror/angle),
CustomModelScale, CubeWithModel.
- Rotation from the prefab (
rotation = roll·16 + pitch·4 + yaw) and from blueprint names
(Name|Yaw=90|Pitch=90).
- States such as
*Rock_Stone_Brick_Smooth_Half_State_Definitions_Block, Parent chains of item
definitions.
- Transparency: cut-out textures (leaves, plants) via alpha test,
RequiresAlphaBlending blocks blended.
Grayscale _GS textures are tinted with Tint* from the block definition or a fixed grass/leaf green.
- Fluids (
fluids array) as translucent cubes.
- Sidebar: size, block count, Y slice slider (hide layers above), block name on hover, details on click,
chests with their droplist, unknown blocks (drawn magenta) with the reason, list of block types.
- Instanced rendering per block type: prefabs with hundreds of thousands of blocks stay usable.
Requirements
Hytale installed through the launcher. The extension reads the vanilla assets directly from Assets.zip
(about 3.7 GB) without extracting it; only the central directory and the entries a prefab needs are read.
Nothing is copied or redistributed.
Installation
npm install
npm run vsix # builds publish/prefab-viewer-<version>.vsix
code --install-extension publish/prefab-viewer-1.0.0.vsix
For development press F5, or start
code --extensionDevelopmentPath=/path/to/VSC-PrefabRenderer /path/to/your/mod.
Commands
| Command |
Title |
hytalePrefabViewer.openPreview |
Hytale: Open Prefab Preview |
Extension Settings
| Setting |
Type |
Default |
Description |
hytalePrefabViewer.assetsZip |
string |
~/.var/app/com.hypixel.HytaleLauncher/data/Hytale/install/release/package/game/latest/Assets.zip |
Vanilla Assets.zip. ~ is expanded. |
hytalePrefabViewer.assetFolders |
string[] |
[] |
Extra asset folders (layout Server/Item/Items/…, Common/…), e.g. a mod's src/main/resources. They win over the zip; earlier entries win over later ones. |
hytalePrefabViewer.detectAssetFolder |
boolean |
true |
Also use the asset folder that contains the opened prefab (nearest parent with Server/Item/Items). For a mod checkout this picks up its own blocks without configuration. |
Example for a mod that is not opened from inside its resources folder:
"hytalePrefabViewer.assetFolders": ["/home/me/code/repos/BetterBiomes/src/main/resources"]
After changing textures or block definitions in a mod folder, press Reload assets in the view (caches are kept
until then).
Known Issues
- Lighting and colors are approximations: no ambient occlusion, block light or biome colors;
_GS textures
without an explicit tint use a fixed green.
- Only the first texture variant (
Textures[0], CustomModelTexture[0]) is used; RandomRotation and
connected-block rules (ConnectedBlockRuleSet, e.g. double chests, fences, roofs) are ignored, so the block is
drawn exactly as named in the prefab.
- Transition textures, side masks (
TextureSideMask) and animations are not rendered.
- Pitch/roll direction follows yaw (rotation about +X / +Z, applied as yaw · pitch · roll); this has been
checked against the data but not against the game for every block.
- Picking works on whole cells: hovering over the empty part of a cell occupied by a small model still selects it.
- Fluids are drawn as full cubes regardless of their level.
- Entities in prefabs (
entities) are not shown.
Please report problems by email to info@mutigeraffe.com.
Development
| Command |
Purpose |
npm run compile |
Type-check, lint and build |
npm run test:unit |
Data-layer tests (vitest); with Hytale installed they also run against the real Assets.zip |
npm test |
Integration tests in VS Code (xvfb-run -a npm test on headless Linux) |
node scripts/render-preview.mjs <prefab> <out.png> [--mod <folder>] |
Renders a prefab headless with Chromium to a PNG (after npm run compile); zip:Server/Prefabs/… reads a vanilla prefab |
Release Notes
See the Changelog tab.
License
Proprietary, all rights reserved. See the LICENSE file for the terms of use. Third-party components and their
licenses are listed in THIRD_PARTY_NOTICES.md.
| |