stewbeet.plugins.resource_pack.item_models
The item_models plugin automatically generates item and block models for custom items defined in the StewBeet framework.
It processes textures, handles powered states, generates specialized models for different block types,
and creates the necessary item model files for Minecraft resource packs.
(This plugin requires item definitions in memory and the textures_folder configuration.)
Some Features Showcase (example from SimplEnergy)
Automatically detects texture patterns:
Both models are automatically created and ready to use (models/item/* and items/*):
Source Code: stewbeet/plugins/resource_pack/item_models/__init__.py
Source Code: stewbeet/plugins/resource_pack/item_models/object.py
What it does
- Generates block models with automatic pattern detection (cube, cake, orientable, etc.)
- Creates item models with proper texture layering and parent inheritance
- Handles powered states for blocks (_on variants)
- Supports specialized models (bow pulling animations, leather armor overlays)
- Automatically processes and copies textures from source folders
- Generates both
items/*.jsonfiles andmodels/[item|block]/*.jsonfiles - Tracks rendered models to prevent duplicates
Dependencies
- β
Required:
Your definition plugin(seedefinitions_setup.mdfor details) - β
Required:
textures_folderconfiguration in meta.stewbeet - π Position: Should run after verification plugins and before finalization
(seebasic/beet.ymlfor an example)
Configuration
Basic Example Configuration
pipeline:
- ...
- src.setup_definitions # Load item definitions into memory
- ...
- stewbeet.plugins.resource_pack.item_models # Check both item definitions and your textures to generate models
- ...
meta:
stewbeet:
textures_folder: "assets/textures" # Path to textures directoryConfiguration Options
| Option | Type | Default | Description |
|---|---|---|---|
textures_folder | string | "assets/textures" | Path to the directory containing texture files. Must be set in meta.stewbeet.textures_folder |
Features
Block Model Generation
Automatically detects texture patterns and generates appropriate block models:
π° Cake Model (requires: bottom, side, top, inner textures)
- Creates main cake model with proper texture mapping
- Generates 6 slice models for each cake state
- Maps
innertexture toinsidein model
π² Cube Bottom Top, e.g. barrel (requires: bottom, side, top textures)
- Uses
minecraft:block/cube_bottom_topparent - Perfect for blocks with different top/bottom faces
β¬οΈ Orientable Model (requires: front, side, top textures)
- Uses
minecraft:block/orientableparent - Ideal for directional blocks like furnaces
π¦ Cube Column (requires: end, side textures)
- Uses
minecraft:block/cube_columnparent - Great for pillar-like blocks
Item Model Generation
- π Uses appropriate parent models based on item type
- π‘οΈ Handles leather armor with layer1 overlays
- πΉ Creates bow pulling animations with range dispatch, and for a crossbow its charge and loaded states
- β‘ Supports powered state variants
Powered State Support
- π Automatically detects
_ontexture variants - π Generates separate models for powered/unpowered states, the plain one selecting the
_onone while a furnace host burns - πͺ Writes the inner and outer corner copies of a stairs block's model, selected from the display's
custom_model_datastring
Texture Processing
- π Recursively scans textures folder for .png files
- π Creates texture mappings for model generation
- π Copies textures to resource pack assets
- π Supports .mcmeta animation files
- π« Handles missing texture validation
Specialized Model Types
Bow Models:
- π― Detects pulling texture variants (
_pulling_0,_pulling_1, etc.) - π Creates range dispatch system for use duration
- π Generates conditional models for bow states
Leather Armor:
- π¨ Automatically adds layer1 texture for color overlays
- π‘οΈ Maintains compatibility with vanilla dyeing system
Item Component Files
- π Generates items/{item_name}.json files
- π― Creates model references for item components
- π§ Uses custom JSON encoder for proper formatting
- πΉ Handles special cases like bow animations
Next steps
- Defining items and blocks: the textures and models this plugin consumes.
- All plugins: the rest of the pipeline, in the order it runs.
- Configuring the build: enabling, ordering and configuring plugins.