Model

@Serializable
data class Model(val parent: ResourcePath<ResourceType.Model>? = null, val textures: Map<String, String> = emptyMap(), val elements: List<Model.Element>? = null, val ambientOcclusion: Boolean? = null, val guiLight: Model.GuiLight? = null, val display: Model.Display? = null)

A Minecraft model.

Parameters

parent

The path to the parent model or null if there is no parent.

textures

A map of texture names to texture paths.

elements

A list of voxels that make up the model.

ambientOcclusion

(Only relevant for block models) Whether ambient occlusion is enabled for the model.

guiLight

(Only relevant for item models) The direction of the light for the item model in the GUI.

display

(Only relevant for item models) Context-dependant display settings.

Constructors

Link copied to clipboard
constructor(parent: ResourcePath<ResourceType.Model>? = null, textures: Map<String, String> = emptyMap(), elements: List<Model.Element>? = null, ambientOcclusion: Boolean? = null, guiLight: Model.GuiLight? = null, display: Model.Display? = null)

Types

Link copied to clipboard
@Serializable
enum Axis : Enum<Model.Axis>

An axis in 3D space.

Link copied to clipboard
@Serializable
enum Direction : Enum<Model.Direction>

A direction in 3D space.

Link copied to clipboard
@Serializable
data class Display(val thirdPersonRightHand: Model.Display.Entry = Entry(), val thirdPersonLeftHand: Model.Display.Entry = thirdPersonRightHand, val firstPersonRightHand: Model.Display.Entry = Entry(), val firstPersonLeftHand: Model.Display.Entry = firstPersonRightHand, val head: Model.Display.Entry = Entry(), val gui: Model.Display.Entry = Entry(), val ground: Model.Display.Entry = Entry(), val fixed: Model.Display.Entry = Entry())

The display settings for an item model, depending on the context.

Link copied to clipboard
@Serializable
data class Element(val from: Vector3dc, val to: Vector3dc, val rotation: Model.Element.Rotation? = null, val faces: Map<Model.Direction, Model.Element.Face>, val shade: Boolean = true, val lightEmission: Int = 0)

A voxel of a Model.

Link copied to clipboard
@Serializable
enum GuiLight : Enum<Model.GuiLight>

Specifies the direction of the light for the item model in the GUI.

Properties

Link copied to clipboard
@SerialName(value = "ambientocclusion")
val ambientOcclusion: Boolean? = null
Link copied to clipboard
val display: Model.Display? = null
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "gui_light")
val guiLight: Model.GuiLight? = null
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Creates a flattened copy of this model using the given context to resolve parent models.

Link copied to clipboard
fun getBounds(context: ModelContent?): AABBd

Gets the bounds of this model's elements. Uses context to resolve parent models.