-
Notifications
You must be signed in to change notification settings - Fork 0
Item Model Data Generation
The Temporal API provides a comprehensive set of annotations for automatically generating item models during data generation. These annotations eliminate the need for manual JSON asset creation by programmatically registering item models based on predefined strategies.
- Automates model generation: Generates item model JSON files without manual asset creation
- Provides model variety: Supports different item types (tools, weapons, blocks, armor, etc.)
- Integrates with data generation: Works seamlessly with NeoForge's data generation system
- Enables customization: Allows custom model strategies for specialized item types
- Annotation processing: The framework scans fields annotated with item model annotations
-
Strategy selection: Each annotation maps to a specific
ItemModelProviderStrategyimplementation -
Model creation: Strategies create appropriate item models using the
ApiItemModelProvider - Data generation: During data generation, models are automatically registered, and JSON files are generated
Generates a basic flat item model for standard items.
@GenerateBasicItemModel
public static final DeferredItem<?> EXAMPLE_INGOT = ITEM_FACTORY.create("example_ingot");Use cases: Materials, ingredients, simple items without special rendering
Generates a handheld item model for tools and weapons.
@GenerateHandheldItemModel
public static final DeferredItem<?> EXAMPLE_SWORD = ITEM_FACTORY.createSword("example_sword", Tiers.NETHERITE, 1, 1f);Use cases: Tools, weapons, items held in hand with a special perspective
Generates a block item model using the cube all texture.
@GenerateCubedBlockItemModel
public static final DeferredItem<?> EXAMPLE_BLOCK = BLOCK_FACTORY.create("example_block");Use cases: Basic blocks with uniform textures on all sides
Generates a bow model with pull animation support.
@GenerateBowItemModel
public static final DeferredItem<?> EXAMPLE_BOW = ITEM_FACTORY.createBow("example_bow");Generates a crossbow model with loading animation support.
@GenerateCrossbowItemModel
public static final DeferredItem<?> EXAMPLE_CROSSBOW = ITEM_FACTORY.createCrossbow("example_crossbow");Generates a spawn egg model with entity-specific coloring.
@GenerateSpawnEggItemModel
public static final DeferredItem<?> EXAMPLE_SPAWN_EGG = ITEM_FACTORY.createSpawnEgg("example_spawn_egg", ExampleEntityTypes.EXAMPLE_ENTITY, 0x473A24FF, 0x71634FFF);Generates an armor item model with trim support.
@GenerateTrimmedArmorItemModel
public static final DeferredItem<?> EXAMPLE_HELMET = ITEM_FACTORY.createArmor("example_helmet", ExampleArmorMaterials.EXAMPLE_ARMOR_MATERIAL, ArmorItem.Type.HELMET);Generates a flat block item model using the block's texture.
Generates a fence block item model with post and rail textures.
Generates a fence gate block item model with open/closed states.
Generates a slab block item model.
Generates stairs block item model.
Generates a wall block item model.
Generates a button block item model.
Generates a pressure plate block item model.
Generates a trapdoor block item model.
Generates a barrel block item model.
Generates a carpet block item model.
Generates a log block item model with bark texture.
Generates a wood block item model.
Allows custom item model generation using a custom strategy.
@GenerateCustomItemModel(
strategy = CustomItemModelStrategy.class,
additionalData = {"custom_param1", "custom_param2"}
)
public static final DeferredItem<?> CUSTOM_ITEM = ITEM_FACTORY.create("custom_item");Parameters:
-
strategy: Custom strategy class implementingItemModelProviderStrategy<CustomItemModelSpec> -
additionalData: Optional string array for custom parameters
Allows custom block item model generation using a custom strategy.
@GenerateCustomBlockItemModel(
strategy = CustomBlockItemModelStrategy.class,
additionalData = {"custom_block_param"}
)
public static final DeferredItem<?> CUSTOM_BLOCK_ITEM = BLOCK_FACTORY.create("custom_block");Place item textures in the appropriate resource directory:
src/main/resources/assets/modid/textures/item/
├── example_ingot.png
├── example_sword.png
├── example_bow.png
├── example_crossbow.png
└── example_spawn_egg.png
For block items, textures are typically in the block texture directory:
src/main/resources/assets/modid/textures/block/
├── example_block.png
├── example_fence.png
└── example_fence_gate.png
-
Standard items: Use
@GenerateBasicItemModelfor simple items -
Tools/weapons: Use
@GenerateHandheldItemModelfor handheld items - Blocks: Use appropriate block item model annotations
- Special items: Use specialized annotations for bows, crossbows, spawn eggs, armor
-
Custom needs: Use
@GenerateCustomItemModelor@GenerateCustomBlockItemModelfor unique requirements
The annotation system integrates with the Temporal API's metadata processing:
-
Strategy interface:
ItemModelProviderStrategy<T>for custom model generation -
Provider class:
ApiItemModelProviderextends NeoForge'sItemModelProvider -
Spec classes: Various spec classes for different model types (
ItemModelSpec,BlockItemModelSpec, etc.) - Custom strategies: Implement custom strategies for specialized item model needs
Each annotation maps to a specific strategy implementation that handles the model generation logic, allowing for easy extension and customization of the item 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