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:
-
"item/generated"
, to use a model that is created out of the item’s icon. -
"builtin/entity"
, to load a model from an entity file.- As you cannot specify the entity, this does not work for all items (only for chests, ender chests, mob heads, shields, banners and tridents).
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
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Model
impl UnwindSafe for Model
Blanket Implementations
Mutably borrows from an owned value. Read more