Struct minecraft_assets::schemas::models::Model[][src]

pub struct Model {
    pub parent: Option<String>,
    pub display: Option<Display>,
    pub textures: Option<Textures>,
    pub elements: Option<Vec<Element>>,
    pub ambient_occlusion: Option<bool>,
    pub gui_light_mode: Option<GuiLightMode>,
    pub overrides: Option<Vec<OverrideCase>>,
}
Expand description

A block or item model as stored in the assets/<namespace>/models/{block,item}/ directories.

See also the corresponding section of the wiki page

Fields

parent: Option<String>

Specifies that this model should inherit fields from the model at the given resource location. If both parent and elements are set, the elements field overrides the elements field from the parent model.

For an item model, this can be set to a couple builtin values:

display: Option<Display>

Contains the different places where item models are displayed in different views.

textures: Option<Textures>

Contains the textures of the model.

elements: Option<Vec<Element>>

Contains all the elements of the model.

If both parent and elements are set, the elements tag overrides the elements tag from the previous model.

ambient_occlusion: Option<bool>

Whether to use ambient occlusion (true - default), or not (false).

Applies only to block models.

gui_light_mode: Option<GuiLightMode>

Specifies how to shade the model in the GUI.

Can be front or side. If set to side, the model is rendered like a block. If set to front, model is shaded like a flat item. Defaults to side.

Applies only to item models.1


  1. In versions >= 1.16.2, it appears that block/block.json also has this field set. 

overrides: Option<Vec<OverrideCase>>

Specifies cases in which a different model should be used based on item tags.

All cases are evaluated in order from top to bottom and last predicate that matches overrides. However, overrides are ignored if it has been already overridden once, for example this avoids recursion on overriding to the same model.

Applies only to item models.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.