Skip to content

Block Model Data Generation

Maksym Uimanov edited this page Feb 12, 2026 · 1 revision

Block Model Data Generation

The Temporal API provides a comprehensive set of annotations for automatically generating block models during data generation. These annotations eliminate the need for manual JSON asset creation by programmatically registering block models based on predefined strategies.

Responsibilities / Purpose

  • Automates model generation: Generates block model JSON files without manual asset creation
  • Provides model variety: Supports different block types (solid, transparent, complex shapes)
  • Integrates with data generation: Works seamlessly with NeoForge's data generation system
  • Enables customization: Allows custom model strategies for specialized block types

How it works

  1. Annotation processing: The framework scans fields annotated with block model annotations
  2. Strategy selection: Each annotation maps to a specific BlockModelProviderStrategy implementation
  3. Model creation: Strategies create appropriate block models using the block model provider
  4. Data generation: During data generation, models are automatically registered, and JSON files are generated

Common Block Model Annotations

@GenerateCubedBlockModel

Generates a basic cube block model with uniform texture on all sides.

@GenerateCubedBlockModel
public static final DeferredBlock<?> EXAMPLE_BLOCK = BLOCK_FACTORY.create("example_block", BlockPropertiesFactory.empty());

Parameters:

  • renderType (optional, default: "minecraft:solid"): Render type for the block

Use cases: Basic blocks, ore blocks, building blocks

@GenerateCrossBlockModel

Generates a cross-shaped block model (like grass or flowers).

@GenerateCrossBlockModel
public static final DeferredBlock<?> EXAMPLE_GRASS = BLOCK_FACTORY.createFlower("example_grass", BlockPropertiesFactory.shortGrass(), MobEffects.DAMAGE_RESISTANCE, 1);

Use cases: Tall grass, flowers, plants

Specialized Block Model Annotations

@GenerateStairsBlockModel

Generates a stairs block model with proper texture mapping.

@GenerateStairsBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_STAIRS = BLOCK_FACTORY.createStair("example_planks_stairs", BlockPropertiesFactory.planks());

Parameters:

  • fullBlock (required): Resource location of the full block texture

@GenerateSlabBlockModel

Generates a slab block model with proper texture mapping.

@GenerateSlabBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_SLAB = BLOCK_FACTORY.createSlab("example_planks_slab", BlockPropertiesFactory.planks());

Parameters:

  • fullBlock (required): Resource location of the full block texture

@GenerateFenceBlockModel

Generates a fence block model with post and rail textures.

@GenerateFenceBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_FENCE = BLOCK_FACTORY.createFence("example_planks_fence");

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the fence
  • fullBlock (required): Resource location of the full block texture

@GenerateFenceGateBlockModel

Generates a fence gate block model with open/closed states.

@GenerateFenceGateBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_FENCE_GATE = BLOCK_FACTORY.createFenceGate("example_planks_fence_gate", ExampleWoodTypes.EXAMPLE_WOOD_TYPE);

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the fence gate
  • fullBlock (required): Resource location of the full block texture

Wood-Based Block Models

@GenerateLogBlockModel

Generates a log block model with bark on sides and wood texture on ends.

@GenerateLogBlockModel
public static final DeferredBlock<?> EXAMPLE_LOG = BLOCK_FACTORY.createLog("example_log", EXAMPLE_STRIPPED_LOG);

Parameters:

  • renderType (optional, default: "minecraft:solid"): Render type for the log

@GenerateWoodBlockModel

Generates a wood block model with log texture on all sides.

@GenerateWoodBlockModel
public static final DeferredBlock<?> EXAMPLE_WOOD = BLOCK_FACTORY.createLog("example_wood", EXAMPLE_STRIPPED_WOOD);

Parameters:

  • renderType (optional, default: "minecraft:solid"): Render type for the wood

Utility Block Models

@GenerateButtonBlockModel

Generates a button block model with pressed/unpressed states.

@GenerateButtonBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_BUTTON = BLOCK_FACTORY.createButton("example_planks_button", ExampleBlockSetTypes.EXAMPLE_BLOCK_SET_TYPE);

Parameters:

  • fullBlock (required): Resource location of the full block texture

@GeneratePressurePlateBlockModel

Generates a pressure plate block model with pressed/unpressed states.

@GeneratePressurePlateBlockModel(fullBlock = "example:example_planks")
public static final DeferredBlock<?> EXAMPLE_PRESSURE_PLATE = BLOCK_FACTORY.createPressurePlate("example_planks_pressure_plate", ExampleBlockSetTypes.EXAMPLE_BLOCK_SET_TYPE);

Parameters:

  • fullBlock (required): Resource location of the full block texture

@GenerateDoorBlockModel

Generates a door block model with open/closed states and proper hinge placement.

@GenerateDoorBlockModel
public static final DeferredBlock<?> EXAMPLE_DOOR = BLOCK_FACTORY.createDoor("example_door", ExampleWoodTypes.EXAMPLE_WOOD_TYPE);

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the door

@GenerateTrapDoorBlockModel

Generates a trapdoor block model with open/closed states.

@GenerateTrapDoorBlockModel
public static final DeferredBlock<?> EXAMPLE_TRAPDOOR = BLOCK_FACTORY.createTrapdoor("example_trapdoor", ExampleWoodTypes.EXAMPLE_WOOD_TYPE);

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the trapdoor

Plant-Based Block Models

@GenerateFlowerBlockModel

Generates a flower block model with cross-shaped texture.

@GenerateFlowerBlockModel(pottedFlower = "example:potted_example_flower")
public static final DeferredBlock<?> EXAMPLE_FLOWER = BLOCK_FACTORY.createFlower("example_flower", MobEffects.DAMAGE_RESISTANCE, 1);

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the flower
  • pottedFlower (required): Resource location of the potted flower variant

@GenerateVineBlockModel

Generates a vine block model with climbing properties.

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the vine

@GenerateCarpetBlockModel

Generates a carpet block model with thin profile.

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the carpet

Sign Block Models

@GenerateSignBlockModel

Generates a standing sign block model with text support.

@GenerateSignBlockModel(wallSign = "example:example_wall_sign", particleTexture = "example:block/example_stripped_log")
public static final DeferredBlock<StandingSignBlock> EXAMPLE_SIGN = BLOCK_FACTORY.createStandingSignWithoutItem("example_sign", 1f, ExampleWoodTypes.EXAMPLE_WOOD_TYPE);

Parameters:

  • wallSign (required): Resource location of the wall sign variant
  • particleTexture (required): Resource location for particle effects

@GenerateHangingSignBlockModel

Generates a hanging sign block model with text support.

@GenerateHangingSignBlockModel(wallHangingSign = "example:example_wall_hanging_sign", particleTexture = "example:block/example_stripped_log")
public static final DeferredBlock<CeilingHangingSignBlock> EXAMPLE_HANGING_SIGN = BLOCK_FACTORY.createCeilingHangingSignWithoutItem("example_hanging_sign", 1f, ExampleWoodTypes.EXAMPLE_WOOD_TYPE);

Parameters:

  • wallHangingSign (required): Resource location of the wall hanging sign variant
  • particleTexture (required): Resource location for particle effects

Utility Block Models

@GenerateWallBlockModel

Generates a wall block model with post and wall segments.

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the wall
  • fullBlock (required): Resource location of the full block texture

@GeneratePaneBlockModel

Generates a glass pane block model with connecting edges.

Parameters:

  • renderType (optional, default: "minecraft:translucent"): Render type for the pane

@GenerateRailBlockModel

Generates a rail block model with curved and straight segments.

Parameters:

  • renderType (optional, default: "minecraft:cutout"): Render type for the rail

@GenerateBarrelBlockModel

Generates a barrel block model with open/closed states.

Parameters:

  • renderType (optional, default: "minecraft:solid"): Render type for the barrel

Custom Block Model Annotation

@GenerateCustomBlockModel

Allows custom block model generation using a custom strategy.

@GenerateCustomBlockModel(
    strategy = CustomBlockModelStrategy.class,
    renderType = RenderTypes.SOLID,
    additionalData = {"custom_param1", "custom_param2"}
)
public static final DeferredBlock<?> CUSTOM_BLOCK = BLOCK_FACTORY.create("custom_block", BlockPropertiesFactory.empty());

Parameters:

  • strategy: Custom strategy class implementing BlockModelProviderStrategy<CustomBlockModelSpec>
  • renderType (optional, default: "minecraft:solid"): Render type for the block
  • additionalData (optional): String array for custom parameters

Render Types

Available render types from RenderTypes class:

  • SOLID ("minecraft:solid"): Standard solid blocks
  • CUTOUT ("minecraft:cutout"): Blocks with transparent pixels that are fully transparent or opaque
  • CUTOUT_MIPPED ("minecraft:cutout_mipped"): Cutout with mipmapping support
  • CUTOUT_MIPPED_ALL ("minecraft:cutout_mipped_all"): Cutout with full mipmapping
  • TRANSLUCENT ("minecraft:translucent"): Blocks with semi-transparent pixels
  • TRIPWIRE ("minecraft:tripwire"): Special render type for tripwires

Asset Requirements

Place block textures in the appropriate resource directory:

src/main/resources/assets/modid/textures/block/
├── example_block.png
├── example_planks.png
├── example_log.png
├── example_log_top.png
├── example_grass.png
└── example_flower.png

When to use

  • Basic blocks: Use @GenerateCubedBlockModel for simple solid blocks
  • Building blocks: Use specialized annotations for stairs, slabs, fences, etc.
  • Natural blocks: Use @GenerateCrossBlockModel for plants and flowers
  • Wood blocks: Use @GenerateLogBlockModel and @GenerateWoodBlockModel for wood variants
  • Utility blocks: Use appropriate annotations for buttons, pressure plates, doors, etc.
  • Custom needs: Use @GenerateCustomBlockModel for unique block model requirements

Extension Points

The annotation system integrates with the Temporal API's metadata processing:

  • Strategy interface: BlockModelProviderStrategy<T> for custom model generation
  • Custom strategies: Implement custom strategies for specialized block model needs
  • Render type support: Flexible render type selection for different visual effects
  • Texture mapping: Automatic texture mapping based on block type and parameters

Each annotation maps to a specific strategy implementation that handles the block model generation logic, allowing for easy extension and customization of the block model generation system.

Clone this wiki locally