Skip to content

Content & World

This section covers content creation and world building features in Hytale, including assets, items, prefabs, and world generation.

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
  1. Assets & Registry - Register custom content and manage assets
  2. Inventory & Items - Player inventories and item management
  3. Prefab System - Create and place structures
  4. Terrain Generation - Customize terrain generation
  5. Fluid System - Fluid storage, ticking/flow, and replication
  6. Time System - Day/night cycle, moon phases, and time packets
  7. Lighting System - Chunk lighting, propagation, and invalidation
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)
// In your plugin's setup method, use getAssetRegistry()
@Override
protected 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)
}
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 blocks
prefab.placeNoReturn(world, new Vector3i(100, 64, 100), componentAccessor);
TypeDescription
AssetsRegistered game content (items, blocks, entities)
ItemsHoldable objects with behaviors
PrefabsPre-built structures and decorations
World GeneratorsTerrain and biome generation logic