Skip to main content

📐 Model

Overview​

Renders a single model file from assets/<namespace>/models/. type defaults to minecraft:model — you can omit it when this is the only type you need.

items:
demo:sword:
material: diamond_sword
model:
path: minecraft:item/custom/sword

Fields​

FieldTypeRequiredDefaultDescription
typestringNominecraft:modelModel type identifier
pathasset pathYes—Namespaced path to the model JSON (e.g. demo:item/sword)
generationobjectNo—Auto-generate the model JSON from a parent template
tintslistNo—Tint sources, indexed by tintindex in the model geometry
transformationobjectNo—Display transform overlay (26.1+)

Generation​

When generation is set, CraftEngine auto-generates the model JSON — you don't need to provide a model file. The parent is the only required field.

items:
demo:sword:
material: diamond_sword
model:
path: demo:item/sword
generation:
parent: minecraft:item/handheld
textures:
layer0: demo:item/sword
layer1: demo:item/sword_glow
display:
thirdperson_righthand:
rotation: 0,0,0
translation: 0,1,1
scale: 0.85,0.85,0.85
gui_light: front
FieldTypeRequiredDescription
parentasset pathYesParent model to inherit from (e.g. minecraft:item/generated)
texturesmapNoTexture variable overrides (layer0, layer1, â€Ļ)
displayobjectNoPer-context display transforms (thirdperson_righthand, gui, ground, fixed, head, firstperson_righthand, â€Ļ)
gui_lightstringNoGUI lighting mode: front or side

Tints​

items:
demo:dyeable_armor:
material: leather_chestplate
model:
path: minecraft:item/custom/armor
generation:
parent: minecraft:item/generated
textures:
layer0: minecraft:item/custom/armor
layer1: minecraft:item/custom/armor_overlay
tints:
- type: minecraft:dye
default: 16777215

Each tint source applies a color to the model faces tagged with the corresponding tintindex. List order = tintindex order (first entry → tintindex: 0).

All color values accept these formats:

value: 16711680 # Decimal (0x00FF0000)
value: 255,0,0 # RGB 0–255
value: 1.0,0.0,0.0 # RGB 0.0–1.0

minecraft:constant​

Returns a fixed RGB color.

tints:
- type: minecraft:constant
value: 16711680 # Red

minecraft:dye​

Returns value from minecraft:dyed_color component, or default if not present.

- type: minecraft:dye
default: 16777215

minecraft:firework​

Returns average of colors from minecraft:firework_explosion component, or default if there are none.

- type: minecraft:firework
default: 16777215

minecraft:grass​

Samples textures/colormap/grass.png by climate.

- type: minecraft:grass
temperature: 0.5 # 0.0–1.0
downfall: 0.5 # 0.0–1.0

minecraft:map_color​

Returns value from minecraft:map_color component, or default if not present.

- type: minecraft:map_color
default: 16777215

minecraft:potion​

Returns color from minecraft:potion_contents component: custom_color if present, otherwise average of effect colors, otherwise default. If component is absent, returns default.

- type: minecraft:potion
default: 16777215

minecraft:team​

Returns the team color of the context entity, or default if no entity, no team, or team has no color.

- type: minecraft:team
default: 16777215

minecraft:custom_model_data​

Reads from the colors list in minecraft:custom_model_data component.

- type: minecraft:custom_model_data
index: 0 # Position in the colors array
default: 16777215