Skip to content

Block System Overview

The Block System manages all block types, block components, 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
BlockModulecom.hypixel.hytale.server.core.modules.block.BlockModule
BlockEntitycom.hypixel.hytale.server.core.modules.block.BlockEntity
BlockReplaceEventcom.hypixel.hytale.server.core.modules.block.BlockReplaceEvent
TickProcedurecom.hypixel.hytale.server.core.asset.type.blocktick.config.TickProcedure
ComponentDescription
BlockTypeAsset definition for block behavior and appearance
Component<ChunkStore>Per-block instance data for stateful blocks
BlockEntityUtility for setting block entities on chunks
BlockReplaceEventECS event for block entity replacement
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 (ECS)
getEntityStoreRegistry().registerSystem(
new MyBreakBlockSystem()
);

See Block Events for full examples using EntityEventSystem.

  1. Use groups: Organize related blocks with the Group property
  2. Use block components sparingly: Only use Component<ChunkStore> when truly needed for persistent data
  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