-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- 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
- Annotation processing: The framework scans fields annotated with block model annotations
-
Strategy selection: Each annotation maps to a specific
BlockModelProviderStrategyimplementation - Model creation: Strategies create appropriate block models using the block model provider
- Data generation: During data generation, models are automatically registered, and JSON files are generated
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
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
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
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
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
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
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
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
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
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
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
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
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
Generates a vine block model with climbing properties.
Parameters:
-
renderType(optional, default:"minecraft:cutout"): Render type for the vine
Generates a carpet block model with thin profile.
Parameters:
-
renderType(optional, default:"minecraft:cutout"): Render type for the carpet
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
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
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
Generates a glass pane block model with connecting edges.
Parameters:
-
renderType(optional, default:"minecraft:translucent"): Render type for the pane
Generates a rail block model with curved and straight segments.
Parameters:
-
renderType(optional, default:"minecraft:cutout"): Render type for the rail
Generates a barrel block model with open/closed states.
Parameters:
-
renderType(optional, default:"minecraft:solid"): Render type for the barrel
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 implementingBlockModelProviderStrategy<CustomBlockModelSpec> -
renderType(optional, default:"minecraft:solid"): Render type for the block -
additionalData(optional): String array for custom parameters
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
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
-
Basic blocks: Use
@GenerateCubedBlockModelfor simple solid blocks - Building blocks: Use specialized annotations for stairs, slabs, fences, etc.
-
Natural blocks: Use
@GenerateCrossBlockModelfor plants and flowers -
Wood blocks: Use
@GenerateLogBlockModeland@GenerateWoodBlockModelfor wood variants - Utility blocks: Use appropriate annotations for buttons, pressure plates, doors, etc.
-
Custom needs: Use
@GenerateCustomBlockModelfor unique block model requirements
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.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples