Skip to content

Block System Overview

The Block System manages all block types, block states, and block-related operations in Hytale. Blocks are the fundamental building units of the world.

ComponentPackage
BlockTypecom.hypixel.hytale.server.core.asset.type.blocktype.config.BlockType
BlockStatecom.hypixel.hytale.server.core.universe.world.meta.BlockState
BlockStateRegistrycom.hypixel.hytale.server.core.universe.world.meta.BlockStateRegistry
TickProcedurecom.hypixel.hytale.server.core.asset.type.blocktick.config.TickProcedure
ComponentDescription
BlockTypeAsset definition for block behavior and appearance
BlockStatePer-block instance data for stateful blocks (deprecated)
BlockStateRegistryRegistration of custom block state types
TickProcedureBlock tick behavior (growth, decay, etc.)
Reading blocks from the world
// Get by ID
BlockType stone = BlockType.getAssetMap().get("Rock_Stone");
// Get from world position
World world = Universe.get().getDefaultWorld();
BlockType type = world.getBlockType(x, y, z);
// Get block ID (numeric)
int blockId = world.getBlock(x, y, z);
// Special block references
BlockType.EMPTY // Air block
BlockType.UNKNOWN // Unknown block placeholder
Writing blocks to the world
// Simple set
world.setBlock(x, y, z, blockType);
// With settings
SetBlockSettings settings = new SetBlockSettings();
settings.setNotifyNeighbors(true);
settings.setUpdateLighting(true);
settings.setTriggerBlockUpdate(true);
world.setBlock(x, y, z, blockType, settings);
Block event handling
getEventRegistry().register(BreakBlockEvent.class, event -> {
BlockType blockType = event.getBlockType();
Vector3i position = event.getPosition();
// Cancel to prevent breaking
event.setCancelled(true);
});
getEventRegistry().register(PlaceBlockEvent.class, event -> {
BlockType blockType = event.getBlockType();
// Handle placement
});
  1. Use groups: Organize related blocks with the Group property
  2. Minimize states: Only use block states when truly needed
  3. Optimize hitboxes: Use appropriate hitbox complexity
  4. Consider support: Define support requirements for physics
  5. Batch updates: Group block changes when possible
  6. Check loaded: Verify chunks are loaded before block access