Content & World
This section covers content creation and world building features in Hytale, including assets, items, prefabs, and world generation.
Overview
Section titled “Overview”Hytale’s content system allows you to:
- Register and manage custom assets
- Create items and inventory systems
- Build and place prefab structures
- Customize world generation
Getting Started
Section titled “Getting Started”- Assets & Registry - Register custom content and manage assets
- Inventory & Items - Player inventories and item management
- Prefab System - Create and place structures
- Terrain Generation - Customize terrain generation
- Fluid System - Fluid storage, ticking/flow, and replication
- Time System - Day/night cycle, moon phases, and time packets
- Lighting System - Chunk lighting, propagation, and invalidation
Architecture
Section titled “Architecture”AssetRegistry (com.hypixel.hytale.assetstore.AssetRegistry)├── AssetStore<K, T, M>[] - Type-specific stores (K=key, T=asset, M=map)│ ├── AssetCodec<K, T> - Serialization/deserialization│ ├── AssetMap<K, T> - Storage and lookup│ └── AssetPack - Content pack container└── Tag indices - TAG_MAP / CLIENT_TAG_MAP (string → int)
World Generation (core + server.worldgen)├── IWorldGen - Generator interface (server.core.universe.world.worldgen)├── IWorldGenProvider - Generator provider (worldgen.provider)├── ChunkGenerator - Terrain generation (server.worldgen.chunk)├── CavePopulator / CaveGenerator / CaveNodeType└── PrefabStore - Structure placement (server.core.prefab)Quick Example
Section titled “Quick Example”Registering an Asset
Section titled “Registering an Asset”// In your plugin's setup method, use getAssetRegistry()@Overrideprotected void setup() { // For String-keyed assets (most common case) getAssetRegistry().register( HytaleAssetStore.builder(MyAsset.class, new IndexedLookupTableAssetMap<>(MyAsset[]::new)) .setPath("MyAssets") .setCodec(MyAsset.CODEC) .setKeyFunction(MyAsset::getId) .build() );
// For custom key types, use the 3-parameter builder // HytaleAssetStore.builder(KeyClass.class, AssetClass.class, assetMap)}Placing a Prefab
Section titled “Placing a Prefab”PrefabStore store = PrefabStore.get();BlockSelection prefab = store.getServerPrefab("structures/house.prefab.json");
// Place at position - requires a CommandSender for feedback// place(CommandSender feedback, World world, Vector3i position, BlockMask mask)prefab.place(commandSender, world, new Vector3i(100, 64, 100), null);
// Alternative: place without returning replaced blocksprefab.placeNoReturn(world, new Vector3i(100, 64, 100), componentAccessor);Content Types
Section titled “Content Types”| Type | Description |
|---|---|
| Assets | Registered game content (items, blocks, entities) |
| Items | Holdable objects with behaviors |
| Prefabs | Pre-built structures and decorations |
| World Generators | Terrain and biome generation logic |
Next Steps
Section titled “Next Steps”- Read the Assets & Registry guide for content registration
- Learn about the Inventory System for item management
- Explore Prefabs for structure placement
- Customize terrain with World Generation