import type { Registry } from 'sandstone/arguments/generated/registry.ts' import type { Axis, Direction } from 'sandstone/arguments/generated/util/direction.ts' import type { ModelType, TextureType } from 'sandstone/arguments' import type { ModelClass, NBTFloat, NBTInt, NBTList, NonEmptyString, TextureClass } from 'sandstone' export type CustomizableItemDisplayContext = ( | 'firstperson_righthand' | 'firstperson_lefthand' | 'thirdperson_righthand' | 'thirdperson_lefthand' | 'gui' | 'head' | 'ground' | 'fixed' | 'on_shelf') export type ItemDisplayContext = ( | 'none' | 'firstperson_righthand' | 'firstperson_lefthand' | 'thirdperson_righthand' | 'thirdperson_lefthand' | 'gui' | 'head' | 'ground' | 'fixed' | 'on_shelf') export type ItemTransform = { /** * Value: * List length range: 3 */ rotation?: NBTList, /** * Value: * List length range: 3 */ translation?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, /** * Value: * List length range: 3 */ scale?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, } export type Model = { parent?: (Registry['minecraft:model'] | ModelClass), ambientocclusion?: boolean, gui_light?: ('front' | 'side'), textures?: ({ [Key in NonEmptyString]?: ((NonEmptyString | `#${string}` | TextureClass) | TextureMaterial) }), elements?: Array, display?: ({ [Key in Extract]?: { /** * Value: * List length range: 3 */ rotation?: NBTList, /** * Value: * List length range: 3 */ translation?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, /** * Value: * List length range: 3 */ scale?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, } }), } export type ModelDisplay = ({ [Key in Extract]?: { /** * Value: * List length range: 3 */ rotation?: NBTList, /** * Value: * List length range: 3 */ translation?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, /** * Value: * List length range: 3 */ scale?: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, } }) export type ModelElement = { /** * Value: * List length range: 3 */ from: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, /** * Value: * List length range: 3 */ to: NBTList, { leftExclusive: false, rightExclusive: false, min: 3, max: 3, }>, faces: ({ [Key in Extract]?: { texture: `#${string}`, /** * Value: * List length range: 4 */ uv?: NBTList, /** * Value: * * - Down(`down`) * - Up(`up`) * - North(`north`) * - East(`east`) * - South(`south`) * - West(`west`) */ cullface?: Direction, rotation?: (0 | 90 | 180 | 270), tintindex?: NBTInt, } }), rotation?: ModelElementRotation, /** * Value: * * - Down(`down`) * - Up(`up`) * - North(`north`) * - East(`east`) * - South(`south`) * - West(`west`) */ shade_direction_override?: Direction, /** * Value: * Range: 0..15 */ light_emission?: NBTInt<{ min: 0, max: 15, }>, } export type ModelElementFace = { texture: `#${string}`, /** * Value: * List length range: 4 */ uv?: NBTList, /** * Value: * * - Down(`down`) * - Up(`up`) * - North(`north`) * - East(`east`) * - South(`south`) * - West(`west`) */ cullface?: Direction, rotation?: (0 | 90 | 180 | 270), tintindex?: NBTInt, } export type ModelElementFaceMap = ({ [Key in Extract]?: { texture: `#${string}`, /** * Value: * List length range: 4 */ uv?: NBTList, /** * Value: * * - Down(`down`) * - Up(`up`) * - North(`north`) * - East(`east`) * - South(`south`) * - West(`west`) */ cullface?: Direction, rotation?: (0 | 90 | 180 | 270), tintindex?: NBTInt, } }) export type ModelElementRotation = (ModelElementRotationBase & ({ [Key in Extract]?: NBTFloat })) export type ModelElementRotationBase = { /** * Value: * List length range: 3 */ origin: NBTList, /** * Defaults to `false`. */ rescale?: boolean, } export type ModelOverride = { predicate: ({ [Key in Extract]?: NBTFloat }), model: ModelRef, } export type ModelOverridePredicates = ({ [Key in Extract]?: NBTFloat }) export type ModelRef = (Registry['minecraft:model'] | ModelClass) export type ModelTextures = ({ [Key in NonEmptyString]?: ((NonEmptyString | `#${string}` | TextureClass) | TextureMaterial) }) export type MultipleAxesModelElementRotation = (ModelElementRotationBase & ({ [Key in Extract]?: NBTFloat })) export type Predicates = ( | 'angle' | 'blocking' | 'broken' | 'cast' | 'charged' | 'cooldown' | 'custom_model_data' | 'damage' | 'damaged' | 'firework' | 'honey_level' | 'lefthanded' | 'level' | 'pull' | 'pulling' | 'throwing' | 'time' | 'tooting' | 'trim_type') export type SingleAxisModelElementRotation = (ModelElementRotationBase & { /** * Value: * * - X(`x`) * - Y(`y`) * - Z(`z`) */ axis: Axis, angle: NBTFloat, }) export type TextureMaterial = { sprite: (Registry['minecraft:texture'] | TextureClass), /** * Whether the texture should be forced into the translucent render pass. \ * Textures without any translucent pixels are not assigned to the translucent pass by default. \ * Defaults to `false`. */ force_translucent?: boolean, }